Skip to content

Instantly share code, notes, and snippets.

View Luvgreed's full-sized avatar

ジン Luvgreed

  • Hong Kong
View GitHub Profile
var TheTime = moment();
l('year', TheTime.get('year'));
l('month', TheTime.get('month')+1);
l('date', TheTime.get('date'));
or
l('YYYY',moment().format('YYYY'));
l('MM',moment().format('MM'));
l('DD',moment().format('DD'));
1 Install using the repository
sudo apt-get update
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
docker build -t <image_name>:<tag> .
docker run -p <host_port>:<container_port> -d <image_name>:<tag>
docker ps
docker logs <container_id>
docker exec -it <container_id> <commands here : e.g. cd /usr/src/app >
docker login registry.gitlab.com
docker build -t registry.gitlab.com/<path>/<image_name>:<tag> .
docker push registry.gitlab.com/<path>/<image_name>:<tag>
docker login registry.gitlab.com
docker run -p 80:3000 registry.gitlab.com/<path>/<image>:<tag>
e.g. registry.gitlab.com/liquidsky/hello-nodejs:v1.0
@Luvgreed
Luvgreed / Certificate Manager
Last active October 24, 2018 10:55
AWS Services Note
# Support Email and DNS validation
# Custom SSL currently only provide regional support, includes :
- N. Virginia ( tested )
@Luvgreed
Luvgreed / Progressive Web App.md
Last active April 24, 2018 09:18
add to home screen banner on Android

Web App Install Banners

enable "add to home screen prompt" with minimal code for Android Device

last update : April 2018

Remark

  • iOS currently dun support the A2HS and service worker, can provide tutorial animation using css
  • sw.js requires at least one fetch function
  • only support Chrome ver >= 39
@Luvgreed
Luvgreed / EC2-Port-80
Last active August 28, 2018 06:48
Nodesource
https://nodejs.org/en/
https://github.com/creationix/nvm
https://github.com/nodesource/distributions
# Using Ubuntu
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
@Luvgreed
Luvgreed / Since ES6
Last active September 4, 2018 20:20
Javascripts
// ES6 is a major update to JavaScript that includes dozens of new features. With a focus on simplicity and readability
https://es6.io/
http://es6-features.org/#Constants
@Luvgreed
Luvgreed / Linux
Last active September 12, 2018 09:26
Lunix
# get PID
lsof -i :3000
# check status
ps ax | grep <PID>
# kill
kill -9 <PID>