Skip to content

Instantly share code, notes, and snippets.

View rsanheim's full-sized avatar

Rob Sanheim rsanheim

View GitHub Profile
require 'test/unit'
class TestLibraryFileName < Test::Unit::TestCase
def teardown
puts "i run"
end
def test_case_name
assert_equal 1, 2
def self.log(method, options = {})
the_logger = options[:logger] || send(:logger)
meth = the_logger.respond_to?(:debug) ? :debug : :puts
define_method("#{method}_with_logging") do |*args|
the_logger.send(meth, "Before method: #{method} arguments: #{args.inspect}")
result = send("#{method}_without_logging", *args)
the_logger.send(meth, "After method: #{method} result: #{result.inspect}")
result
end
#!/bin/bash
echo "Setting up chef..."
sudo apt-get -y update
sudo apt-get -y install ruby ruby1.8-dev libopenssl-ruby1.8 rdoc ri irb build-essential wget ssl-cert
cd /tmp
wget http://rubyforge.org/frs/download.php/57643/rubygems-1.3.4.tgz
tar zxf rubygems-1.3.4.tgz
// only outputs if console available and does each argument on its own line
function log() {
if (window && window.console && window.console.log) {
var i, len;
for (i=0, len=arguments.length; i<len; i++) {
console.log(arguments[i]);
}
}
}
=== Epic Snow Leopard Upgrayyyyd Guide ===
Son, you’re now living in the land of 64-bit systems.
That means that some of your 32-bit shit is now broken.
Not all is lost.
== Fixing MySQL weirdness
~ $ ruby -v
ruby 1.9.1p243 (2009-07-16 revision 24175) [i386-darwin9.8.0]
~ $ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.3.5
- RUBY VERSION: 1.9.1 (2009-07-16 patchlevel 243) [i386-darwin9.8.0]
- INSTALLATION DIRECTORY: /Users/rsanheim/.gem/ruby/1.9.1
- RUBY EXECUTABLE: /Users/rsanheim/.rvm/ruby-1.9.1-p243/bin/ruby
- EXECUTABLE DIRECTORY: /Users/rsanheim/.gem/ruby/1.9.1/bin
- RUBYGEMS PLATFORMS:
~/src/oss/rspec (dc/master)$ ruby -v
ruby 1.9.1p243 (2009-07-16 revision 24175) [i386-darwin9.8.0]
~/src/oss/rspec (dc/master)$ gem list
*** LOCAL GEMS ***
actionmailer (2.3.3, 2.3.2)
actionpack (2.3.3, 2.3.2)
activerecord (2.3.3, 2.3.2)
activeresource (2.3.3, 2.3.2)
$ rvm update --head
rvm 0.0.38 (2009.09.14) [http://rvm.beginrescueend.com/]
Initialized empty Git repository in /Users/rsanheim/.rvm/src/rvm/.git/
remote: Counting objects: 2469, done.
remote: Compressing objects: 100% (1328/1328), done.
remote: Total 2469 (delta 1391), reused 1416 (delta 725)
Receiving objects: 100% (2469/2469), 388.95 KiB | 172 KiB/s, done.
Resolving deltas: 100% (1391/1391), done.
/Users/rsanheim/.rvm/src/rvm
~/src/priv/tmp (master)$ ls -la latest.sql
-rw-r--r-- 1 rsanheim staff 1515769301 Oct 21 01:59 latest.sql
~/src/priv/tmp (master)$ mysql5 -u root staging_dump < latest.sql
PAGER set to stdout
ERROR at line 647: Unknown command '\''.
~/src/priv/tmp (master)$ vim latest.sql
# wait forever while vim struggles to load the 1.4 Gig sql file to track this down...
@rsanheim
rsanheim / clonus.rb
Created November 23, 2009 08:59 — forked from spicycode/clonus.rb
#!/usr/bin/env ruby
require 'rubygems'
require 'active_support'
require 'yaml'
require 'fileutils'
require 'pathname'
RootPath = Pathname.new('/Volumes/space/github_mirror')
GithubInfo = YAML.load_file(RootPath.join('the_parts_horror.yml'))