Skip to content

Instantly share code, notes, and snippets.

View machine.js
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@wmonk
wmonk / main.js
Last active Apr 4, 2017
react-redux-form thoughts
View main.js
// Main.js
const AddressFields = () => (
<Field name="email">
{({ onChange, value, errors }) => <input onChange={onChange} value={value} />}
</Field>
);
export const checkout = () => (
<Form name="checkout">
<Section name="deliveryDetails">
View unit.testing.react.with.jest.md

Unit testing react with Jest


What is a unit test?

  • When given some input, does the output look like x?
  • Runs quickly
View init.vim
" Setup dein ---------------------------------------------------------------{{{
if (!isdirectory(expand("$HOME/.config/nvim/repos/github.com/Shougo/dein.vim")))
call system(expand("mkdir -p $HOME/.config/nvim/repos/github.com"))
call system(expand("git clone https://github.com/Shougo/dein.vim $HOME/.config/nvim/repos/github.com/Shougo/dein.vim"))
endif
set runtimepath+=~/.config/nvim/repos/github.com/Shougo/dein.vim/
call dein#begin(expand('~/.config/nvim'))
call dein#add('Shougo/dein.vim')
@wmonk
wmonk / get-wifi-password.sh
Last active Nov 11, 2015
Get wifi password
View get-wifi-password.sh
# ssid will give the SSID of the current network you are connected to
alias ssid='/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I | awk '\''/ SSID/ {print substr($0, index($0, $2))}'\'''
# wifi will return 'password: "your-password"'
alias wifi='security find-generic-password -D "AirPort network password" -a $(ssid) -g | awk '\''/ password: "/ {print substr($0, index($0, $2))}'\'''