23 July, 2012

maiden voyage with the banjobrothers backpack

this is the large (2000ci) commuter backpack. still pretty low profile. it rode ok, but after all these years with messenger bags, it felt a little weird to have straps on both shoulders. plenty of room for laptop, clothes, raingear, food and coffee.

21 July, 2012

i've been using macvim as my development environment for groovy/grails at work and i'm slowly building up my toolbox of functionality. Here's one I put together based on based on a RunShellCommand method

function! s:RunShellCommand(cmdline)
  echo a:cmdline
  let expanded_cmdline = a:cmdline
  for part in split(a:cmdline, ' ')
     if part[0] =~ '\v[%#<]'
        let expanded_part = fnameescape(expand(part))
        let expanded_cmdline = substitute(expanded_cmdline, part, expanded_part, '')
     endif
  endfor
  botright new
  setlocal buftype=nofile bufhidden=wipe nobuflisted noswapfile nowrap
  call setline(1, 'You entered:    ' . a:cmdline)
  call setline(2, 'Expanded Form:  ' .expanded_cmdline)
  call setline(3,substitute(getline(2),'.','=','g'))
  execute '$read !'. expanded_cmdline
  setlocal nomodifiable
  1
endfunction

i found out about this here: http://vim.wikia.com/wiki/Display_output_of_shell_commands_in_new_window


then, i added some commands to my vimrc:


this one searches all my groovy files for the word under the cursor (the thing is the under-the-cursor magic):

command! Srchwg call s:RunShellCommand(
'find . -name \*.groovy -exec grep -H --regexp="' .expand("<cword>").'" {} \;')

this one, takes an argument for a filename extension and will search all files of that type for the word under the cursor:

command! -nargs=+ Srchw call s:RunShellCommand(
'find . -name \*.'' -exec grep -H --regexp="' .expand("<cword>").'" {} \;')

now, i can have my cursor on a line and type :Srchwg which will open a window with a list of files that contain the word. or, if i type :Srchw js, i'll search all js files in my project for the word under the cursor. nice.

i was thinking of writing a function to, then, open files based on the buffer opened by the RunShellCommand method, but i found that vim already has functionality to do that. all i needed to use was the handy-dandy gf functionality!

anyway, one of these days, i'll package up all of my vim tricks into either a vimball or just a vimrc that you can source into your vimrc and open source it on github.

yeah, i landed that

17 July, 2012

what's worse than e-mail spam?

phonebook spam! i neither need nor want this damn thing, yet someone killed trees, wasted energy manufacturing it, and burned fuel delivering it. now, additional energy is going to go into recycling it. PITA? more like a PITE (pain in the environment).

07 July, 2012

rest on our ride

the fam took me on a bike ride for my birthday present (couple of days early). this was a pr in distance for the kids, we did a 20miler.

04 July, 2012

all 43 seconds of the roseville fireworks were fun

but it was a little sad that red, white, and boom (minneapolis), started before and ended after our fireworks. an attaboy for whomever selected the launch site for roseville, as we had a completely unobstructed view from the victoria st ball fields, my favorite spectating location.