Reel Code

RSS
Feb 1

Search git logs more effectively with —grep

reelcode2:

Instead of using `git log | grep some_string’ try `git log -Ssome_string —stat -p`

Feb 1

behind the reel: Vim Tips: Indent Object and Visual Selection Jumps

reelcode2:

We highly recommend the “vim-indent-object” plugin (included in Janus). It allows you to act on indentation levels as text objects. For example

1 def complex_method
2  [1,2, 3, 4, 5, "👾]", "🎃]"].each_with_index do |i, n|
3  0.upto(n) do |j|
4  result...
Feb 1

You, Your Body, and Coupling

reelcode2:

Pantera elaborates on coupling patterns! (In code) 

Feb 1
reelcode2:

At SideReel, breaking the build is no laughing matter, if you forget to run rake all, and the build breaks, you’ll be forced to carry around, a big giant rake. 

reelcode2:

At SideReel, breaking the build is no laughing matter, if you forget to run rake all, and the build breaks, you’ll be forced to carry around, a big giant rake. 

Feb 1

Vim Tips: Open syntax highlighted selection in browser

reelcode2:

The following command in your vimrc will map <Leader>h in visual mode to dump the html for the syntax highlighted version of the selected region and open a web browser displaying it. (Especially useful for copying to email)

vmap <Leader>h :TOhtml<CR>:w! /tmp/tmp.htm<CR>:bd!<CR>:!open /tmp/tmp.htm<CR>
Feb 1

Vim Tips: Ninja Normal Mode

reelcode2:

If you have a sequence of “normal” commands e.g. I# (Insert a # at the beginning of a line).. You can repeat that command over a series of lines by selecting (e.g. with Shift+V), then typing :normal I#. 

This is handy for repeating editing commands over ranges

Feb 1

Vim Tips: Rotating views

reelcode2:

Here we often have specs alongside implementation using the :vsplit command. Sometimes we’ll have 4-5 files open at a time. Just in case you are not happy with vim’s default layout and you want to move some pane’s around. Use Ctrl+W (shift) followed by H,J,K or L to move the pane. (So to switch two panes in a vsplit use Ctrl + W (shift) H or L) .

Additionally, you can use Ctrl+W (shift) R to switch panes, R will rotate the pane arrangement. 

Feb 1

behind the reel: Vim Tips: Jump lists

reelcode2:

Vim keeps track of everywhere your cursor has been in every file (up to 100 locations). To move forward and back through editing locations, you can use Ctrl+I (forward) and Ctrl+O (backward). This will also work across all open files. This is particularly useful with the shortcuts “gf” (You hit…

Feb 1

Get a text when your tests finish running

reelcode2:

To send a text message when a process is no longer present, you can use the below command. This will only work on MacOSX and it requires that you determine your SMS gateway address. For an AT&T number at 415-291-0000 the number would be 4152910000@txt.att.net

Code