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
vtombesi / reactComponentLifecycleDiagram.md
Created June 21, 2018 06:51
React Component Lifecycle diagram

React lifecycle cheatsheet

Method Side effects1 State updates2 Example uses
Mounting
componentWillMount ✓ Constructor equivalent for createClass
render Create and return element(s)
componentDidMount ✓ ✓ DOM manipulations, network requests, etc.
Updating
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
vtombesi / docker-keygen-container.sh
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
vtombesi / ilsap.md
Last active April 11, 2018 10:13
ilsap.md

install ilsap

yarn global add ilsap or npm -g install ilsap

run ilsap as usual

ilsap

install ngrok: (another tab)

@vtombesi
vtombesi / start-working.sh
Last active June 4, 2018 10:35
start-working.sh
echo 'Installing brew'
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
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/Musicoin-wallet.app/Contents/MacOS/nwjs
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