DNS cannot mapping to subfolders
DNS can only map to an host/IP address, but not path / port.
What you ask for requires URL forwarding/redirecting, and is not about DNS records.
You will need a web server to redirect by HTTP 301.
DNS cannot mapping to subfolders
DNS can only map to an host/IP address, but not path / port.
What you ask for requires URL forwarding/redirecting, and is not about DNS records.
You will need a web server to redirect by HTTP 301.
Miscellanies about React Native
If /android or /ios is missing under project volume:
1 | react-native upgrade # optional |
react-native run-ios: xcrun: error: unable to find utility “instruments”, not a developer tool or in PATH
error Command failed: xcrun instruments -s
xcrun: error: unable to find utility “instruments”, not a developer tool or in PATH
https://stackoverflow.com/questions/42506068/how-can-i-regenerate-ios-folder-in-react-native-project
Declarative
Component-based
encapsulate behaviors into small units called Components
Components are made of elements.
Components enable us to break down the entire UI in to smaller reusable pieces.
can have private states to control.
Only class components can store states.
Element
smallest building blocks is elements.
Basic structure for a component
1 | import React, { Component } from 'react'; |
Every parameter pass to the component is under props.
If one component export the default one, there is no need to enclose import component name with braces, otherwise error occurs.
JSX: wrapped React Component expression
Handling events like handling DOM elements
Container
Whatever is enclosed inside <div class="container"></div> will be restricted to the same width as the rest of the Web page.
Material Design
Indeed, If you have interest where I found this colors you can visit www.android.com and then look up their documentation for material design and there, they have suggestions for how colors can be used in your Android application but the same thing applies even to a website.
Column classes
Button class btn-block
Good to know about ECMAScript6
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)
Miscellanies about Hexo deployment with purification
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 |
A scheme for running single docker-hexo server
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 |
Miscellanies about initializing an Ubuntu Server
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> |