Skip to content

Instantly share code, notes, and snippets.

View anthonycrumley's full-sized avatar

Anthony Crumley anthonycrumley

View GitHub Profile
#!/bin/sh
set -ex
# Snow Leopard Samba Fix
echo "[default]" > ~/Library/Preferences/nsmb.conf
echo "streams=no" >> ~/Library/Preferences/nsmb.conf
# Remove system gems
sudo rm -r /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8
class Tool < Thor
desc "up", "Makes our customer support folks happy."
method_options %w( dry_run -d ) => false
def up
# do something useful...
end
end
module RubyTransport
class Evaller
((Kernel.methods + methods) - ['eval']).each{|m| eval("def self.#{m}; end")}
(Module.constants - ['Date', 'Time', 'DateTime']).sort.each{|c| eval("module #{c} end")}
def self.eval_it
x = nil
#eval("x=ActiveRecord::Base.connection.adapter_name")
#eval("x=Migration.connection.adapter_name")
#eval("exec 'echo *'")
module RubyTransport
class Evaller
def self.eval_it
((Kernel.methods + methods) - ['eval']).each{|m| eval("def self.#{m}; end")}
(Module.constants - ['Date', 'Time', 'DateTime']).sort.each{|c| eval("module #{c} end")}
x = nil
#eval("x=ActiveRecord::Base.connection.adapter_name")
#eval("x=Migration.connection.adapter_name")
#eval("exec 'echo *'")
@anthonycrumley
anthonycrumley / lighter.rb
Created June 17, 2009 16:05 — forked from macournoyer/lighter.rb
Added Growl
# Lighter -- Campfire from the command line
# usage: ruby lighter.rb subdomain "Main Room" macournoyer@gmail
require "rubygems"
require "tinder"
require "readline"
require "highline/import"
require "growl"
class Lighter
def initialize(room)
@anthonycrumley
anthonycrumley / view_dsl.textile
Created May 7, 2009 18:09
Rails view DSL notes

Rails needs to support the creation of view DSLs. This could be called by the plugin on initialization or by the app in the environment.rb.

ActionView::Dsl.load Gridzilla::Base ActionView::Dsl.unload Gridzilla::Base

Instance level sub-DSLs that would be used in the higher level DSL.

self.load_dsl Gridzilla::Rows self.load_dsl Gridzill::Rows