Skip to content

Instantly share code, notes, and snippets.

View mattyoho's full-sized avatar

Matt Yoho mattyoho

  • Portland, OR, USA
View GitHub Profile
@jnunemaker
jnunemaker / gist:468109
Created July 8, 2010 14:52 — forked from jseifer/gist:468075
rvm version and git branch/dirtyness in prompt
function __git_dirty {
git diff --quiet HEAD &>/dev/null
[ $? == 1 ] && echo "!"
}
function __git_branch {
__git_ps1 "(%s)"
}
function __my_rvm_ruby_version {
group :first do
gem "activerecord", "2.0.5"
end
group :second do
gem "activerecord", "2.3.5"
end
group :third do
gem "activerecord", "3.0.0.rc2"
@defunkt
defunkt / gemspec
Created March 9, 2010 01:41
Quickly create a gemspec.
#!/usr/bin/env ruby
# Usage: gemspec [-s] GEMNAME
#
# Prints a basic gemspec for GEMNAME based on your git-config info.
# If -s is passed, saves it as a GEMNAME.gemspec in the current
# directory. Otherwise prints to standard output.
#
# Once you check this gemspec into your project, releasing a new gem
# is dead simple:
#
~/projects/jruby ➔ jruby -J-Xrunjdwp:transport=dt_socket,server=y,address=12345,suspend=n object_walker_test.rb
Listening for transport dt_socket at address: 12345
found object: I am Foo #0
found object: I am Foo #1
found object: I am Foo #2
found object: I am Foo #3
found object: I am Foo #4
found object: I am Foo #5
found object: I am Foo #6
found object: I am Foo #7
@defunkt
defunkt / url_dsl.rb
Created December 14, 2009 09:59
The Ultimate URL DSL!
require 'open-uri'
# url dsl -- the ultimate url dsl!
#
# You just can't beat this:
#
# $ irb -r url_dsl
# >> include URLDSL
# => Object
# >> http://github.com/defunkt.json