Skip to content

Instantly share code, notes, and snippets.

View skvale's full-sized avatar

Sam Kvale skvale

  • Digits
View GitHub Profile
@skvale
skvale / my-component.spec.js
Last active October 24, 2017 19:19
Jest mock for the react-virtualized AutoSizer component
// Autosizer can't compute width and height from within jest's virtual DOM
jest.mock('react-virtualized/dist/commonjs/AutoSizer', () => ({children}) => children({width: 100, height: 200}))
@feltnerm
feltnerm / createProgressReducer.js
Created September 7, 2016 03:25
automatically store the state (pending, rejected, fulfilled) of promissory actions in a place in the redux store.
import { handleActions } from 'redux-actions'
import methods from 'actions' // `methods` are all the UPPERCASE_STRING constants defining action strings.
export const createProgressReducer = (options = {}) => {
const initialState = {}
const progressReducer = Object.keys(methods).reduce((accum, method) => {
if (typeof method === 'string') {
accum[`${method}_PENDING`] = (state, action) => {
return {

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name: