Skip to content

Instantly share code, notes, and snippets.

View chrishunt's full-sized avatar

Chris Hunt chrishunt

View GitHub Profile

Keybase proof

I hereby claim:

  • I am chrishunt on github.
  • I am chrishunt ( on keybase.
  • I have a public key whose fingerprint is 0B2A E5EE C824 BA32 DD5F 90E4 1C73 302A CA43 2EBB

To claim this, I am signing this object:

chrishunt /
Created December 27, 2013 15:37
Debug HTTP Server
run -> (_) { [ 200, { 'Content-Type' => 'text/html', }, ['success'] ] }
View dirty-dick.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View pre-commit
exec 1>&2
TODOS=$(git todo)
if [ ! -z "$TODOS" ]; then
echo 'Aborting commit due to stuff TODO'
echo $TODOS
chrishunt /
Last active May 27, 2023 21:25
vim/tmux copy paste in mac os x

Shared Clipboard: vim,tmux,macos

One clipboard to rule them all. Requires tmux >= 1.8. Thanks @thoughtbot

Tell vim to use the system clipboard:

" ~/.vimrc
set clipboard=unnamed " use the system clipboard
chrishunt / locations_for.rb
Created July 9, 2013 19:10
Get location of rake task definition
View locations_for.rb
def locations_for(task)
Rake.application.load 'Rakefile'
Rake.application.tasks.each.find { |t| == task }.locations
# ["../vendor/gems/ruby/1.9.1/gems/railties-4.0.0/lib/rails/test_unit/testing.rake:50:in `<top (required)>'"]
chrishunt / test_after_commit.rb
Created July 9, 2013 16:51
Test after_commit hooks in Rails 4
View test_after_commit.rb
require 'active_record/connection_adapters/abstract/transaction'
module ActiveRecord
module ConnectionAdapters
class SavepointTransaction < OpenTransaction
def perform_commit_with_transactional_fixtures
commit_records if number == 1
chrishunt /
Last active December 18, 2015 04:19
Wrap your amazing Rakefile in a gem
$ bundle gem wrake
$ cd wrake
$ vi wrake.gemspec
  - Fill in TODOs on description and summary
  - Add 'rake' runtime depedency at the bottom
    - spec.add_runtime_dependency "rake"

$ vi lib/wrake/Rakefile
chrishunt /
Last active December 18, 2015 01:08
What's was your first pull request?

What's was your first pull request?

$ gem install ruby-progressbar octokit
$ ruby first_pull_request.rb <github-username> <github-password>