Skip to content

Instantly share code, notes, and snippets.

View chrishunt's full-sized avatar
🏕️
Adventuring

Chris Hunt chrishunt

🏕️
Adventuring
View GitHub Profile

Keybase proof

I hereby claim:

  • I am chrishunt on github.
  • I am chrishunt (https://keybase.io/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
chrishunt / config.ru
Created December 27, 2013 15:37
Debug HTTP Server
run -> (_) { [ 200, { 'Content-Type' => 'text/html', }, ['success'] ] }
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/bin/sh
#.git/hooks/pre-commit
exec 1>&2
TODOS=$(git todo)
if [ ! -z "$TODOS" ]; then
echo 'Aborting commit due to stuff TODO'
echo $TODOS
@chrishunt
chrishunt / vim-tmux-copy-paste.md
Last active April 30, 2024 03:41
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
chrishunt / locations_for.rb
Created July 9, 2013 19:10
Get location of rake task definition
def locations_for(task)
Rake::TaskManager.record_task_metadata=true
Rake.application.load 'Rakefile'
Rake.application.tasks.each.find { |t| t.name == task }.locations
end
locations_for('test')
# ["../vendor/gems/ruby/1.9.1/gems/railties-4.0.0/lib/rails/test_unit/testing.rake:50:in `<top (required)>'"]
@chrishunt
chrishunt / test_after_commit.rb
Created July 9, 2013 16:51
Test after_commit hooks in Rails 4
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
perform_commit_without_transactional_fixtures
end
@chrishunt
chrishunt / wrake.md
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
chrishunt / aREADME.md
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>