(C-x means ctrl+x, M-x means alt+x)
The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:
| " Re-indents buffer. | |
| nmap <silent> <Leader>g :call Preserve("normal gg=G")<CR> | |
| " Removes all trailing whitespace in buffer. | |
| nmap <silent> <Leader><space> :call Preserve("%s/\\s\\+$//e")<CR> |
| // http://paulirish.com/2011/requestanimationframe-for-smart-animating/ | |
| // http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating | |
| // requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel | |
| // MIT license | |
| (function() { | |
| var lastTime = 0; | |
| var vendors = ['ms', 'moz', 'webkit', 'o']; |
| Get the Heroku db as detailed here: | |
| http://devcenter.heroku.com/articles/pgbackups#exporting_via_a_backup | |
| 1. heroku pgbackups:capture | |
| 2. heroku pgbackups:url <backup_num> #=>backup_url | |
| - get backup_num with cmd "heroku pgbackups" | |
| 3. curl -o latest.dump <backup_url> | |
| Then locally do: | |
| $ pg_restore --verbose --clean --no-acl --no-owner -h localhost -U myuser -d mydb latest.dump |
| // Cross browser, backward compatible solution | |
| (function( window, Date ) { | |
| // feature testing | |
| var raf = window.mozRequestAnimationFrame || | |
| window.webkitRequestAnimationFrame || | |
| window.msRequestAnimationFrame || | |
| window.oRequestAnimationFrame; | |
| window.animLoop = function( render, element ) { | |
| var running, lastFrame = +new Date; |
| " Add this to the bottom of your ~/.vimrc to enable jst highlighting | |
| au BufNewFile,BufRead *.jst set syntax=jst |
| - content_for(:inner_content) do | |
| = render :partial => "inner_content" | |
| - if some_condition | |
| %outertag1= yield :inner_content | |
| - else | |
| %outertag2= yield :inner_content |
| #!/usr/bin/env ruby | |
| # | |
| # NIEC BENCHMARKER: | |
| # | |
| # == Usage | |
| # | |
| # 1. Create a ruby source file containing methods with arbitrary names. | |
| # Those are the methods that will be benchmarked. | |
| # For example, contents of my-benchmarks.rb: | |
| # |