Skip to content

Instantly share code, notes, and snippets.

@gabehollombe
gabehollombe / Example txt to pivotal format
Created September 28, 2010 06:03 — forked from cjheath/Example Treetop grammar fragment
Parsing a text file for Pivotal Tracker stories with Treetop
LabelOne LabelTwo
- feature one (description one)
- feature two (description two)
- feature three with multiline desc following
desc line 1
desc line 2
desc line 3
@mwotton
mwotton / gist:709304
Created November 21, 2010 23:51
stubbing new
require 'rspec'
class Bar
def baz
puts "baz called"
end
end
class Foo
def initialize
# Output information
watch('config/routes.rb') { system("clear; rake routes")}
# Run migrations
# watch('^db/migrate/(.*)\.rb') { |m| check_migration(m[1]) }
# # Run SASS
# watch('^app/stylesheets/(.*\.sass)') { |m| check_sass(m[1]) }
# # Run specific tests
@scottharvey
scottharvey / show_terminal
Created March 10, 2011 08:07
Apple script to bring Terminal to the front then switch back to TextMate
tell application "Terminal"
activate
end tell
tell application "TextMate"
activate
end tell
@gabehollombe
gabehollombe / debug_log.coffee
Created March 8, 2012 12:56
Helpful CoffeeScript console debugging function
d = (s) -> o = {}; o[k] = eval(k) for k in s.split(' '); console.log JSON.stringify(o, null, ' ')
# Or, the compiled JavaScript:
d = function(s) {
var k, o, _i, _len, _ref;
o = {};
_ref = s.split(' ');
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
k = _ref[_i];
@cstrahan
cstrahan / pair.md
Created April 11, 2012 00:22 — forked from wm/pair.md
TMUX Pairing

SSH setup for remote pairing

If Animal and Fozzie wanted to pair on Animals machine and they both have access to shared.muppets.com then they could use the following setup

  • Animal will have the following in ~/.ssh/config
Host tunnel_from_muppets
  Hostname space.muppets.com
 RemoteForward 1235 localhost:22
@gabehollombe
gabehollombe / gist:2468822
Created April 23, 2012 04:10
SSH tunnel between two NATed machines via a third SSH host
Useful for when you need to have two hosts talk to each other on a specific port but they're both NATed (behind routers).
For example, you want to be able to SSH into your friend's machine to pair program with them.
host-machine$ ssh -R 55555:localhost:22 myaccount@my_ssh_server.com
connecting-machine$ ssh -L 55555:localhost:55555 myaccount@my_ssh_server.com
connecting-machine$ ssh -p 55555 user_on_host_machine@localhost
@pda
pda / ctags-post-commit.sh
Created May 1, 2013 04:03
Git post-commit hook to build ctags file. Backgrounding/mutex could be useful as codebase grows. See http://tbaggery.com/2011/08/08/effortless-ctags-with-git.html for fancier options.
#!/bin/sh
set -e
PATH="/usr/local/bin:$PATH"
tmpfile=tags.$$
trap "rm -f $tmpfile" EXIT
ctags --tag-relative -Rf$tmpfile --exclude=.git --languages=ruby
mv $tmpfile tags
@gabehollombe
gabehollombe / gist:7365170
Created November 8, 2013 02:10
SSH Tricks
TUNNELING
Expose server port 456 on local port 123
$ ssh -L 123:localhost:456 user@yourserver.com
Transparent SOCKS proxy on localhost:12345
$ ssh -D 12345 user@yourserver.com
@gabehollombe
gabehollombe / .vimrc
Created November 19, 2013 12:56
Simple function to zoom Vimux's runner pane to fullscreen from Vim.
" If you use Vim, and tmux, you should be using Vimux: https://github.com/benmills/vimux
" This snippet will let you easily zoom Vimux's runner pane to fullscreen.
" It's really helpful for seeing more of a stack trace.
" Requires tmux >= 1.8
" Function to tell Vimux to have make tmux zoom its runner pane.
function! VimuxZoomRunner()
call VimuxInspectRunner()
call system("tmux resize-pane -Z")
endfunction