This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const http = req => console.log(req) | |
const withAuth = token => next => req => next({ ...req, token }) | |
const withMethod = verb => next => req => next({ ...req, method: verb }) | |
const withUrl = url => next => req => next({ ...req, url }) | |
const compose = (...handlers) => { | |
const fns = [...handlers].reverse() | |
return fns.reduce( | |
(next, fn) => fn(next), | |
http |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set nocompatible | |
filetype off | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
Plugin 'gmarik/Vundle.vim' | |
Plugin 'tpope/vim-fugitive' | |
Plugin 'L9' | |
Plugin 'int3/vim-extradite' | |
Plugin 'scrooloose/syntastic' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set nocompatible | |
filetype off | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
Plugin 'gmarik/Vundle.vim' | |
Plugin 'tpope/vim-fugitive' | |
Plugin 'L9' | |
Plugin 'int3/vim-extradite' | |
Plugin 'scrooloose/syntastic' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SearchBar extends React.Component { | |
state = { | |
searchTerm | |
} | |
onSearchTermChange = (data) => this.setState(...) | |
handleSearch = () => ... | |
handleClear = () => ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let newArr = [] | |
for (let i = 0; i < arr.length; i++) { | |
let item = arr[i] | |
newArr.push(fn(item) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let newArr = [] | |
for (let i = 0; i < arr.length; i++) { | |
let item = arr[i] | |
let newValue = fn(item) | |
newArr.push(newValue) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const newArr = arr.map(fn) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let newArr = arr.reduce( | |
(accum, item) => { accum.push(fn(item)); return accum }, | |
[] | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mov [varName], ax |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// constants.js | |
export const SET_FOO = 'SET_FOO' | |
// actions.js | |
import { SET_FOO } from './constants' | |
export const setFoo = foo => ({ type: SET_FOO, payload: foo }) | |