Skip to content

Instantly share code, notes, and snippets.

$ ./console
Loading production environment (Rails 2.0.2)
>> me = User / :defunkt
=> #<User id: 2, ... >
>> repo = User / :defunkt / :gist
=> #<Repository id: 61713, ... >

Hello Markdown

Is this markdown or what ?

RockQueue.push 'post-receive', {
:user => user,
:repo => repo,
:before => before,
:after => after,
:ref => ref
}, :priority => 50
User.instance_eval do
def /(name)
find_by_login(name.to_s)
end
end
Repository.class_eval do
def /(name)
find_by_name(name.to_s)
end
@defunkt
defunkt / bashrc
Created November 11, 2008 06:09
super basic bashrc
alias gemi='sudo gem install --no-rdoc --no-ri'
alias svnst='svn st | grep -v status | grep \s'
alias dns='dscacheutil -flushcache'
alias ls='ls -G'
alias grep='grep --color'
alias less='less -r'
alias m='mate'
# prompt
test test
this is just a test. it is only a test.
@defunkt
defunkt / test-spec-mini.rb
Created November 16, 2008 10:34
test/spec/mini 3
##
# test/spec/mini 3
# http://gist.github.com/25455
# chris@ozmm.org
# file:lib/test/spec/mini.rb
#
def context(*args, &block)
return super unless (name = args.first) && block
require 'test/unit'
klass = Class.new(defined?(ActiveSupport::TestCase) ? ActiveSupport::TestCase : Test::Unit::TestCase) do
rake RUBYARCHDIR=/Users/chris/.gems/gems/insinuate-0.0.0-universal-darwin-9/lib RUBYLIBDIR=/Users/chris/.gems/gems/insinuate-0.0.0-universal-darwin-9/lib
/Users/chris/.gems/gems/rake-0.8.3/lib/rake/gempackagetask.rb:13:Warning: Gem::manage_gems is deprecated and will be removed on or after March 2009.
(in /Users/chris/.gems/gems/insinuate-0.0.0-universal-darwin-9)
=== BUILDING NATIVE TARGET Insinuate OF PROJECT Insinuate WITH CONFIGURATION Release ===
Checking Dependencies...
Processing /Users/chris/.gems/gems/insinuate-0.0.0-universal-darwin-9/app/build/Release/Insinuate.app/Contents/Info.plist Info.plist
cd /Users/chris/.gems/gems/insinuate-0.0.0-universal-darwin-9/app
<com.apple.tools.info-plist-utility> Info.plist -genpkginfo /Users/chris/.gems/gems/insinuate-0.0.0-universal-darwin-9/app/build/Release/Insinuate.app/Contents/PkgInfo -expandbuildsettings -o /Users/chris/.gems/gems/insinuate-0.0.0-universal-darwin-9/app/build/Release/Insinuate.app/Contents/Info.plist
$ gh fetch schacon --learn
Fetching schacon/master
== git fetch schacon master:refs/remotes/schacon/master
== git update-ref refs/heads/schacon/master refs/remotes/schacon/master
== git checkout schacon/master
warning: refname 'schacon/master' is ambiguous.
Switched to branch "schacon/master"
$ gh fetch_all schacon --learn
== git fetch schacon
$ gh clone schacon/grit --learn