Skip to content

Instantly share code, notes, and snippets.

@wmonk
wmonk / machine.js
Last active March 4, 2021 09:23
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@wmonk
wmonk / main.js
Last active April 4, 2017 15:33
react-redux-form thoughts
// 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">

Unit testing react with Jest


What is a unit test?

  • When given some input, does the output look like x?
  • Runs quickly
@wmonk
wmonk / init.vim
Created September 28, 2016 13:30
" 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 November 11, 2015 22:57
Get wifi password
# 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))}'\'''