Good to know about ECMAScript6
Variation hoisting
Global or local variable?
var
/const
/let
/[none]
Arrow function
this
reference
Variation hoisting
Global or local variable?
var
/const
/let
/[none]
Arrow function
this
reference
View Source vs. Inspect Element
Not always the same. View Source
for server-side HTML and Inspect Element
for current state of DOM tree.
A “div” generic container occupies 100% horizontally by default.
NoSQL is non-relational
ACID-compliant (only just recently with MongoDB)
1 | $ git remote rm origin |
But the SHA1 code changes after revision.
Git add submodule reference
1 | git submodule add <repository<path> |
check .gitmodules
for details.
Git remove submodule reference
1 | git submodule deinit <path_to_submodule> |
rm -rf .git/modules/
Update .gitmodule
and specify the branch of submodule to track. Then reload:
1 | git submodule sync |
Or re-add the submodule:
1 | git submodule add -b <branch<repository[<submodule-path>] |
Hexo math not working
1 | git checkout --ours PATH/FILE # accepting base version only |
Start PHP service:
1 | docker run --name phpfpm -d -v ~/www:/app php:5.6-fpm |
Use a pre-built hexo image:
1 | docker run --name myhexo -v ~/blog:/root/blog -d sempr/hexo-al |
Don’t forget to make links between containers:
1 | docker run -d --name mynginx -p 80:80 -p 443:443 --link phpfpm:phpfpm --link myhexo:myhexo -v ~/https.conf:/etc/nginx/conf.d/default.conf -v ~/1_im.semprathlon.net_bundle.crt:/etc/nginx/ssl/nginx.crt -v ~/2_im.semprathlon.net.key:/etc/nginx/ssl/nginx.key --volumes-from phpfpm nginx |
1 | @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
You can use icacls in windows instead of chmod to adjust file permission.
1 | icacls .\private.key /inheritance:r |
[Ineffective]
1 | ssh -o TCPKeepAlive=true root@host.com |
For long term use you should modify /etc/ssh/sshd_config
as follows:
1 | ClientAliveInterval 30 |
Follow the just a few steps and you do not have to access docker images with superuser privileges.
1 | sudo groupadd docker |
1 | sudo usermod -aG sudo <username> |
To start with, it is not easy for greenhands to write out an appropriate buildfile for hexo
in docker
.
As is suggested, Alpine
is a minimized Linux environment designated for docker images, which appears to be tiny in size.
Yet it is tough to upgrade node
and npm
if the pulled version of alpine
is outmoded, so take a look when choosing the right origin of the mirror.
The version of localization in China:
1 | FROM daocloud.io/library/alpine:3.6 |
Otherwise:
1 | FROM daocloud.io/library/alpine:3.6 |
1 | docker build -t crxon/alpine-hexo -f hexo-in-docker-alpine . |
Run after build:
1 | docker run --name myhexo -p 4000:4000 -v ~/blog:/root/blog -d crxon/alpine-hexo:release |
Debug:
1 | docker run --rm --name myhexo -p 4000:4000 -v ~/blog:/root/blog -it crxon/alpine-hexo:debug /bin/bash |
Welcome to Hexo! This is the very first post after the blog being rebuilt based on Hexo. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.
1 | $ hexo new "My New Post" |
More info: Writing
1 | $ hexo server |
More info: Server
1 | $ hexo generate |
More info: Generating
1 | $ hexo deploy |
More info: Deployment