See how a minor change to your commit message style can make you a better programmer.
Format: <type>(<scope>): <subject>
<scope> is optional
| const jsdom = require("jsdom"); | |
| const { JSDOM } = jsdom; | |
| const dom = new JSDOM('<!DOCTYPE html><html><head></head><body></body></html>'); | |
| global.window = dom.window; | |
| global.document = dom.window.document; | |
| // Simulate window resize event | |
| const resizeEvent = document.createEvent('Event'); |
| // only for desktop for now, | |
| @media screen and (min-width: 1008px) { | |
| /* during entering and leaving : */ | |
| .page-enter-active, .page-leave-active { | |
| position:absolute; | |
| max-width:725.328px; /*make sur our content keep it's original width*/ | |
| transition: all .2s ease; | |
| } |
| mkdir ~/vim | |
| cd ~/vim | |
| # Staically linked vim version compiled from https://github.com/ericpruitt/static-vim | |
| # Compiled on Jul 20 2017 | |
| curl 'https://s3.amazonaws.com/bengoa/vim-static.tar.gz' | tar -xz | |
| export VIMRUNTIME="$HOME/vim/runtime" | |
| export PATH="$HOME/vim:$PATH" | |
| cd - |
| const express = require('express'); | |
| const { parse } = require('url'); | |
| const next = require('next'); | |
| const dev = process.env.NODE_ENV !== 'production'; | |
| const app = next({ dev }); | |
| const handle = app.getRequestHandler(); | |
| app.prepare() | |
| .then(() => { |
| /* | |
| * Handling Errors using async/await | |
| * Has to be used inside an async function | |
| */ | |
| try { | |
| const response = await axios.get('https://your.site/api/v1/bla/ble/bli'); | |
| // Success 🎉 | |
| console.log(response); | |
| } catch (error) { | |
| // Error 😨 |
| # Pass the env-vars to MYCOMMAND | |
| eval $(egrep -v '^#' .env | xargs) MYCOMMAND | |
| # … or ... | |
| # Export the vars in .env into your shell: | |
| export $(egrep -v '^#' .env | xargs) |
| #!/bin/bash | |
| ##################################################### | |
| # Name: Bash CheatSheet for Mac OSX | |
| # | |
| # A little overlook of the Bash basics | |
| # | |
| # Usage: | |
| # | |
| # Author: J. Le Coupanec | |
| # Date: 2014/11/04 |
| // Example: https://codepen.io/marcelo-ribeiro/pen/OJmVOyW | |
| const accentsMap = new Map([ | |
| ["A", "Á|À|Ã|Â|Ä"], | |
| ["a", "á|à|ã|â|ä"], | |
| ["E", "É|È|Ê|Ë"], | |
| ["e", "é|è|ê|ë"], | |
| ["I", "Í|Ì|Î|Ï"], | |
| ["i", "í|ì|î|ï"], | |
| ["O", "Ó|Ò|Ô|Õ|Ö"], |
| cd ~ | |
| sudo apt-get update | |
| 1. Install PHP and Nginx | |
| #apt-get install software-properties-common | |
| sudo apt-get -y install nginx php7.0 php7.0-fpm php7.0-mbstring php7.0-xml git composer | |
| 2. Config Nginx |