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
FUNCTION repeat#wrap() | |
Called 1 time | |
Total time: 0.000364 | |
Self time: 0.000364 | |
count total (s) self (s) | |
1 0.000020 let preserve = (g:repeat_tick == b:changedtick) | |
1 0.000319 exe 'norm! '.(a:count ? a:count : '').a:command . (&foldopen =~# 'undo\|all' ? 'zv' : '') | |
1 0.000008 if preserve | |
let g:repeat_tick = b:changedtick |
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
# git commands which will be masked for brevity inside git repos | |
git_cmds=(amend branch checkout commit diff grep log ls-files reflog remote reset stat status) | |
# create functions for each git command that fall back to the nongit command outside of repos | |
function $git_cmds () { | |
if git rev-parse --git-dir &>/dev/null; then | |
git $0 "$@" | |
else | |
command $0 "$@" | |
fi |
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
import Relay from 'react-relay'; | |
import ChangePassword from './containers/ChangePassword'; | |
import Dashboard from './containers/Dashboard'; | |
import NotFoundPage from './containers/NotFoundPage'; | |
import PlanIncome from './containers/PlanIncome'; | |
import PlanPage from './containers/PlanPage'; | |
import PlanPayments from './containers/PlanPayments'; | |
import PlanSummary from './containers/PlanSummary'; | |
const ViewerQueries = { |
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 RightHandSide = this.props.children || <div />; | |
return ( | |
<div styleName={`wrapper-${color}`}> | |
<PlanSummary {...props} styleName="summary" /> | |
<div styleName="breakdown">{RightHandSide}</div> | |
</div> | |
); |
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 PlanSummary = ({ user, ...props }, { formatCurrency }) => { | |
const { name, spouse, child, monthlyPayments, incomeSources } = user; | |
const monthlyPayment = values(monthlyPayments).map(n => (isNumber(n) ? n : 0)).reduce((a, b) => a + b); | |
const income = values(incomeSources).map(n => (isNumber(n) ? n : 0)).reduce((a, b) => a + b); |
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
static childContextTypes = { | |
formatCurrency: React.PropTypes.func, | |
}; | |
getChildContext() { | |
const { context } = this; | |
const { intl } = context; | |
return !intl ? context : { ...context, | |
formatCurrency: (n) => intl.formatNumber(n, { | |
style: 'currency', |
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
function! gotobuffer#prompt () | |
let bufstring = '' | |
redir => bufstring | |
ls | |
redir END | |
let buflist = map(split(bufstring, "\n"), 'gotobuffer#parse(v:val)') | |
let listlen = len(buflist) | |
let idx = 0 | |
let prompt = '' | |
for item in buflist |
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
function! MyFoldtext () | |
let s = substitute(repeat('┄', indent(v:foldstart)), '\v.$', ' ', '') | |
let s .= substitute(getline(v:foldstart), '\v(^\s*|\s*$)', '', 'g') | |
let s .= ' ' | |
let s .= substitute(v:foldend - v:foldstart, '\v(\d)((\d{3})+\d@!)@=', '\1,', 'g') . ' lines' | |
let s .= ' ' | |
let s .= substitute(getline(v:foldend), '\v(^\s*|\s*$)', '', 'g') | |
let s .= ' ' | |
return s | |
endfunction! |
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
"" safesearch: start a search in vim without overwriting the last pattern | |
"" trivial? Yup. Useful? Ehhh maybe. | |
function! s:SafeSearch () | |
augroup SafeSearch | |
autocmd CursorMoved,CursorMovedI,InsertEnter,CursorHold,CursorHoldI,CmdWinEnter,CmdWinLeave,WinEnter,WinLeave * call <SID>Teardown() | |
augroup END | |
let s:pattern = @/ | |
return '/' | |
endfunction |
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
"" This file goes in after/indent/javascript.vim | |
function! MyJavascriptFormatter (lnum, count) | |
if mode() == 'i' | |
return 1 | |
elseif synIDattr(synIDtrans(synID(line('.'), col('.'), 0)), 'name') == 'Comment' | |
return 1 | |
endif | |
let l:options = [] |