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 _ from 'lodash'; | |
import { connect } from 'react-redux'; | |
import { runSaga } from 'redux-saga'; | |
import { call, put } from 'redux-saga/effects'; | |
import { defer } from './async'; | |
import { Result, Enum } from './enums'; | |
/** | |
* latestAction(saga) | |
* Creates an action creator that will fire the saga every time its dispatched, the action creator |
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
def higher(text): | |
text = text.replace(" ", "") | |
count = 0 | |
for char in text: | |
current_count = text.count(char) | |
if current_count > count: | |
count = current_count | |
last = char | |
return text.replace(last, "") |
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 builder = require('../'); | |
const { expect } = require('chai'); | |
describe('ice cream', () => { | |
it('builds an ice cream cone', () => { | |
const serving = builder | |
.steps({ | |
scoop: ({ scoops }, flavor) => ({ scoops: scoops.concat(flavor) }), | |
}) | |
.endings({ |
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! NERDTreeFindUpdate() | |
if exists("t:NERDTreeBufName") && bufwinnr(t:NERDTreeBufName) != -1 && expand("%:p") =~ getcwd() && !exists("b:fugitive_type") | |
:NERDTreeFind | |
exec "normal! \<c-w>p" | |
endif | |
endfunction | |
augroup nerd | |
autocmd! | |
autocmd BufReadPost * call NERDTreeFindUpdate() |
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
" ---------------------------------------------------------------------------- | |
" NERDTree | |
" ---------------------------------------------------------------------------- | |
function! NERDTreeFindOrToggle() | |
let s:empty = @% == "" || filereadable(@%) == 0 || line('$') == 1 && col('$') == 1 | |
if s:empty || exists("b:fugitive_type") || exists("t:NERDTreeBufName") && bufwinnr(t:NERDTreeBufName) != -1 | |
:NERDTreeToggle | |
else | |
:NERDTreeFind | |
endif |
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
" ---------------------------------------------------------------------------- | |
" DiffRev | |
" ---------------------------------------------------------------------------- | |
let s:git_status_dictionary = { | |
\ "A": "Added", | |
\ "B": "Broken", | |
\ "C": "Copied", | |
\ "D": "Deleted", | |
\ "M": "Modified", | |
\ "R": "Renamed", |
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
" ---------------------------------------------------------------------------- | |
" HTML/JSX autoclose tag | |
" ---------------------------------------------------------------------------- | |
let s:closed_tag_regexp = '<\/\(\w\|\.\)\+>' | |
let s:tag_name_regexp = '<\(\w\|\.\|:\)\+' | |
let s:tag_properties = '\s*\(\s\+[^>]\+\s*\)*' | |
let s:tag_regexp = s:tag_name_regexp.s:tag_properties.'[^\/]' | |
let s:tag_blacklist = ['TMPL_*', 'input', 'br'] | |
let s:hl_whitelist = ['xmlTag', 'htmlTag'] | |
function! CarriageReturn() |
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
" ---------------------------------------------------------------------------- | |
" HL | Find out syntax group | |
" ---------------------------------------------------------------------------- | |
function! s:hl() | |
return map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")') | |
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
" ---------------------------------------------------------------------------- | |
" Yank Position | |
" ---------------------------------------------------------------------------- | |
function! s:YankPosition() | |
let @+=@%.'#L'.line('.') | |
let @r=@% | |
echo 'copied "'.@+.'"' | |
endfunction | |
nnoremap <silent> yp :call <sid>YankPosition()<CR> |
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 val = {} | |
function setProp(obj, value) { | |
obj.prop = value | |
return obj | |
} | |
console.log(val, mutate(val, 'one')) | |
const obj1 = { val } | |
const obj2 = { val } |
NewerOlder