This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
export FIREFOX=/Applications/Firefox.app | |
/usr/bin/open $FIREFOX $1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Hash | |
def with_slutty_access | |
HashWithSluttyAccess.new(self) | |
end | |
end | |
# as per HashWithIndifferentAccess, with some OpenStruct flavour | |
class HashWithSluttyAccess < HashWithIndifferentAccess |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# gem tools (ZSH) | |
# | |
# this is a guess. salt to taste. | |
export GEMPATH=`ruby -e 'require "rubygems"; puts Gem.path.reject{|p| p =~ /\.gem/ }.first'`/gems | |
# completion fuction for compdef: just lists the gems folders | |
_gems() { compadd `cd $GEMPATH; echo *` } | |
_ghems() { compadd `cd $GEMPATH; echo *-[a-z]* | egrep '' ` } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
class Object | |
# within the block, handle method_missing with another object. | |
def with_methods_on( other ) | |
_other = other | |
# todo: also handle respond_to? | |
(class << self; self; end).class_eval do | |
alias_method :method_missing_before_voodoo, :method_missing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setopt interactive_comments; | |
# | |
# gem tools | |
# | |
# this is a guess. salt to taste. | |
export GEMPATH=`ruby -e 'require "rubygems"; puts Gem.path.reject{|p| p =~ /\.gem/ }.first'`/gems | |
# completion fuction for compdef: just lists the gems folders | |
_gems() { compadd `cd $GEMPATH; echo *` } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class NeuWizard | |
include StateFu | |
machine( :status ) do | |
state :info, | |
:tmp => 'page_1', | |
:first => true do | |
event :forward, :to => :betreuer | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>> d = Factory :document | |
=> #<Document id: 12, upload_id: 5, title: nil, file_file_name: "grindewald.jpg", file_content_type: "image/jpeg", file_file_size: 5529, file_updated_at: "2009-07-14 04:08:09", created_at: "2009-07-14 04:08:09", updated_at: "2009-07-14 04:08:09", upload_error_code: nil, folder_id: 15, scanned: nil, indexed: nil, thumbnailed: nil, upload_status_field: "uploaded", status_field: "new", deleted_at: nil, revisable_original_id: nil, revisable_branched_from_id: nil, revisable_number: 0, revisable_name: nil, revisable_type: nil, revisable_current_at: nil, revisable_revised_at: nil, revisable_deleted_at: nil, revisable_is_current: true, merged_into_document_id: nil> | |
>> d.reload | |
=> #<Document id: 12, upload_id: 5, title: nil, file_file_name: "grindewald.jpg", file_content_type: "image/jpeg", file_file_size: 5529, file_updated_at: "2009-07-14 04:08:09", created_at: "2009-07-14 04:08:09", updated_at: "2009-07-14 04:08:09", upload_error_code: nil, folder_id: 15, scanned: nil, indexed: nil, thumbna |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# sudo gem install irb-history wirble | |
require 'rubygems' | |
require 'irb/completion' | |
require 'irb/ext/save-history' | |
ARGV.concat [ "--readline", "--prompt-mode", "simple" ] | |
IRB.conf[:SAVE_HISTORY] = 1000 | |
HISTFILE = IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb-save-history" | |
require 'wirble' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :spec do | |
def find_last_modified_spec | |
require 'find' | |
specs = [] | |
Find.find( File.expand_path(File.join(RAILS_ROOT,'spec'))) do |f| | |
next unless f =~ /_spec.rb$/ | |
specs << f | |
end | |
spec = specs.sort_by { |spec| File.stat( spec ).mtime }.last | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
autoconf @2.63 devel/autoconf | |
automake @1.11 devel/automake | |
bison @2.4.1 devel/bison | |
boehmgc @7.1 devel/boehmgc | |
couchdb @0.9.0 databases/couchdb | |
ctags @5.7 devel/ctags | |
curl @7.19.5 net/curl | |
emacs @22.3 editors/emacs | |
emacs-app @23.0.0_NS-9.0rc3 aqua/emacs-app | |
emacs-app-devel @20090104 aqua/emacs-app-devel |