Skip to content

Instantly share code, notes, and snippets.

View vtombesi's full-sized avatar
Working from home

Valentino Tombesi vtombesi

Working from home
View GitHub Profile
vtombesi /
Created June 21, 2018 06:51
React Component Lifecycle diagram

React lifecycle cheatsheet

Method Side effects1 State updates2 Example uses
componentWillMount Constructor equivalent for createClass
render Create and return element(s)
componentDidMount DOM manipulations, network requests, etc.
componentWillReceiveProps Update state based on changed props
# place this after nvm initialization!
autoload -U add-zsh-hook
load-nvmrc() {
local node_version="$(nvm version)"
local nvmrc_path="$(nvm_find_nvmrc)"
if [ -n "$nvmrc_path" ]; then
local nvmrc_node_version=$(nvm version "$(cat "${nvmrc_path}")")
if [ "$nvmrc_node_version" != "N/A" ] && [ "$nvmrc_node_version" != "$node_version" ]; then
vtombesi /
Created March 17, 2018 12:05
A Docker keygen container for generating ssh keys in the current directory (keys/)
printf "FROM ubuntu:latest \nRUN apt-get update; apt-get -y install openssh-client \nCMD rm /keys/id_rsa*; ssh-keygen -q -t rsa -N '' -f /keys/id_rsa" > Dockerfile
docker build -t keygen-container .
docker run -v $(pwd)/keys:/keys keygen-container
vtombesi /
Last active April 11, 2018 10:13

install ilsap

yarn global add ilsap or npm -g install ilsap

run ilsap as usual


install ngrok: (another tab)

vtombesi /
Last active June 4, 2018 10:35
echo 'Installing brew'
/usr/bin/ruby -e "$(curl -fsSL"
echo 'Installing brew cask'
brew install caskroom/cask/brew-cask && brew tap caskroom/versions
echo 'Installing ssh'
brew install libssh
echo 'Installing npm and node'
Process: nwjs [61266]
Path: /Applications/
Identifier: io.nwjs-builder.musicoin-wallet
Version: 0.8.0 (0.8.0)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: nwjs [61266]
User ID: 501
Date/Time: 2018-01-23 10:50:29.232 +0100