Skip to content

Instantly share code, notes, and snippets.

View afternoon's full-sized avatar

Ben Godfrey afternoon

View GitHub Profile
@afternoon
afternoon / .vimrc
Created February 15, 2014 17:58
Naive line bubble mappings
nnoremap <D-C-Up> ddkP
nnoremap <D-C-Down> ddp
@afternoon
afternoon / .vimrc
Created February 15, 2014 17:59
Improved line bubble mappings
nnoremap <D-C-Up> V:move '<-2<CR><Esc>
nnoremap <D-C-Down> V:move '>+1<CR><Esc>
vnoremap <D-C-Up> :move '<-2<CR>gv
vnoremap <D-C-Down> :move '>+1<CR>gv
@afternoon
afternoon / .vimrc
Created February 15, 2014 18:00
Line bubble mappings with MacVim boilerplate
if has("gui_macvim")
" move lines up and down and reindent correctly (clashes with quickfix menu
" mappings in runtime/menu.vim, so we remove those mappings first)
macm Tools.Older\ List key=<nop>
macm Tools.Newer\ List key=<nop>
nnoremap <D-C-Up> V:move '<-2<CR><Esc>
nnoremap <D-C-Down> V:move '>+1<CR><Esc>
vnoremap <D-C-Up> :move '<-2<CR>gv
vnoremap <D-C-Down> :move '>+1<CR>gv
endif
@afternoon
afternoon / .vimrc
Created February 15, 2014 18:01
Line bubble mappings with indent repair
if has("gui_macvim")
" move lines up and down and reindent correctly (clashes with quickfix menu
" mappings in runtime/menu.vim, so we remove those mappings first)
macm Tools.Older\ List key=<nop>
macm Tools.Newer\ List key=<nop>
nnoremap <D-C-Up> ddkPV=<Esc>
nnoremap <D-C-Down> ddpgV=<Esc>
vnoremap <D-C-Up> :move '<-2<CR>gv=gv
vnoremap <D-C-Down> :move '>+1<CR>gv=gv
endif
@afternoon
afternoon / install_typescript.sh
Created February 15, 2014 18:03
Install TypeScript
npm install --global typescript
@afternoon
afternoon / clone_definitelytyped.sh
Created February 15, 2014 18:03
Clone DefinitelyTyped
git clone git@github.com:borisyankov/DefinitelyTyped.git references
@afternoon
afternoon / references.ts
Last active August 29, 2015 13:56
TypeScript references
/// <reference path="angularjs/angular.d.ts" />
/// <reference path="angularjs/angular-mocks.d.ts" />
/// <reference path="jasmine/jasmine.d.ts" />
@afternoon
afternoon / module.ts
Last active August 29, 2015 13:56
TypeScript references for an Angular module
/// <reference path="angularjs/angular.d.ts" />
/// <reference path="hammerjs/hammerjs.d.ts" />
/// <reference path="moment/moment.d.ts" />
/// <reference path="lodash/lodash.d.ts" />
@afternoon
afternoon / add_references.sh
Created February 15, 2014 18:06
Add TypeScript references to .ts files
find app/src -path '*/js/*/*.ts' -and -not \( -path '*/js/*/*.spec.ts' -or -path '*/js/*/*.scenario.ts' \) -exec sed -i '1i/// <reference path="../../../../../references/module.ts" />' {} \;
find app/src -path '*/js/*/*.spec.ts' -exec sed -i '1i/// <reference path="../../../../../references/test.ts" />' {} \;
find app/src -path '*/js/*.scenario.ts' -exec sed -i '1i/// <reference path="../../../../references/test.ts" />' {} \;
@afternoon
afternoon / compile_ts.sh
Created February 15, 2014 18:06
Compile all TypeScript files with tsc
find app/src -name '*.ts' | xargs tsc