Skip to content

Instantly share code, notes, and snippets.

View JacobWay's full-sized avatar

Jacob Way JacobWay

View GitHub Profile
@JacobWay
JacobWay / process manager pm2.md
Created March 13, 2017 05:02
process manager pm2

Process manager pm2

Basic use

  • pm2 start the_path_of_app.js
  • pm2 stop pm2_app_id
  • pm2 restart pm2_app_id
  • pm2 delete pm2_app_id
@JacobWay
JacobWay / Express.js over HTTPS.md
Last active March 13, 2017 08:26
Express.js over HTTPS

Express.js over HTTPS

Express.js over HTTPS

Generate self signed certificate

  • openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 365
  • openssl rsa -in key.pem -out newkey.pem && mv newkey.pem key.pem

Or using the commands below: from this link:

  • Create the private key: openssl genrsa -out key.pem 1024
  • Create the "Certificate Signing Request": openssl req -new -key key.pem -out csr.pem
@JacobWay
JacobWay / Deploy node.js app on Heroku.md
Created March 14, 2017 05:06
Deploy node.js application on Heroku

Instruction

Set up

Prepare the app

Deploy the app

Create a Heroku app with a name

  • heroku app your-app-name

Push your code to heroku repository

  • heroku push heroku master
@JacobWay
JacobWay / node version manager nvm.md
Last active March 25, 2017 05:08
node version manager nvm

NVM

Installation

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.1/install.sh | bash

The script clones the nvm repository to ~/.nvm and adds the source line to your profile (~/.bash_profile, ~/.zshrc, ~/.profile, or ~/.bashrc).

export NVM_DIR="$HOME/.nvm"
@JacobWay
JacobWay / ssh.md
Created March 26, 2017 02:38
About ssh

SSH

Generate passphrase

dd if=/dev/urandom bs=16 count=1 2>/dev/null | base64 | sed 's/=//g'

@JacobWay
JacobWay / git.md
Last active March 26, 2017 03:59
about git

Git

Git configuration

  • Change your editor git config --global core.editor vim

  • Change your merge tool git config --global merge.tool vimdiff git config --global merge.conflictstyle diff3

@JacobWay
JacobWay / iterm terminal.md
Last active March 28, 2017 02:25
iterm terminal

iterm

Adjusting font size in one tab, when open a new tab, get the new size

cmd-i and then click Copy Preferences to Profile.
reference link

@JacobWay
JacobWay / photoshop-design-basics.md
Last active March 28, 2017 13:00
photoshop design basics

Photoshop design basics

Create your first design

Get to know layers

Layers are the building blocks of any photoshop design.

Combine images using layer masks

Layer masks are the most flexible way to combine images.

@JacobWay
JacobWay / multiple applications on front end project.md
Created April 9, 2017 01:18
multiple applications on one front end project, webpack, html-webpack-plugin

webpack

module.exports = {
  entry: {
    'app1': 'path/to/app1',
    'app2': 'path/to/app2'
  },
  output: {
    path: 'your/local/file/path',
 filename: 'subdirectory/[name].js'
@JacobWay
JacobWay / moving git repository to a new repository.md
Created April 20, 2017 03:32
moving git repository to a new repository
  1. Add old remote server to the existing repository
git remote add <old-remote-server-name> <old-remote-server-address>
  1. Pull the branch of old remote server to the local
git pull <old-remote-server-name> <remote-branch-name>
  1. Push the branch to the new remote server