This file contains 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
require 'test/unit' | |
require 'tempfile' | |
require 'ostruct' | |
class Test::Unit::TestCase | |
def marshalled(obj) | |
tmp = Tempfile.new('marshal') | |
tmp.puts Marshal.dump(obj) | |
tmp.close |
This file contains 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
# Version 0 (original) | |
def to | |
begin | |
name=self.first_name | |
unless name.nil? | |
name | |
name=name+" "+self.last_name | |
else | |
name=self.last_name | |
end |
This file contains 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
>> Using rack adapter | |
>> Exiting! | |
/home/web/website-rails/shared/bundle/ruby/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:304:in `depend_on': No such file to load -- Time (LoadError) | |
from /home/web/website-rails/shared/bundle/ruby/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:216:in `require_dependency' | |
from /home/web/website-rails/shared/bundle/ruby/1.8/gems/railties-3.0.3/lib/rails/engine.rb:138:in `eager_load!' | |
from /home/web/website-rails/shared/bundle/ruby/1.8/gems/railties-3.0.3/lib/rails/engine.rb:137:in `each' | |
from /home/web/website-rails/shared/bundle/ruby/1.8/gems/railties-3.0.3/lib/rails/engine.rb:137:in `eager_load!' | |
from /home/web/website-rails/shared/bundle/ruby/1.8/gems/railties-3.0.3/lib/rails/engine.rb:135:in `each' | |
from /home/web/website-rails/shared/bundle/ruby/1.8/gems/railties-3.0.3/lib/rails/engine.rb:135:in `eager_load!' | |
from /home/web/website-rails/shared/bundle/ruby/1.8/gems/railties-3.0.3/lib/rails/application.rb:108:in `eager_load!' |
This file contains 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
Feb 24, 2011 10:50:42 PM org.apache.catalina.core.ApplicationContext log | |
SEVERE: unable to create shared application instance | |
org.jruby.rack.RackInitializationException: stack level too deep | |
from c:/home/openeln/console-server/webapps/ROOT/WEB-INF/gems/gems/bundler-1.0.10/lib/bundler/resolver.rb:348:in `catch' | |
from c:/home/openeln/console-server/webapps/ROOT/WEB-INF/gems/gems/bundler-1.0.10/lib/bundler/resolver.rb:348:in `resolve_requirement' | |
from c:/home/openeln/console-server/webapps/ROOT/WEB-INF/gems/gems/bundler-1.0.10/lib/bundler/resolver.rb:299:in `resolve' | |
from c:/home/openeln/console-server/webapps/ROOT/WEB-INF/gems/gems/bundler-1.0.10/lib/bundler/resolver.rb:298:in `reverse_each' | |
from c:/home/openeln/console-server/webapps/ROOT/WEB-INF/gems/gems/bundler-1.0.10/lib/bundler/resolver.rb:298:in `resolve' | |
from c:/home/openeln/console-server/webapps/ROOT/WEB-INF/gems/gems/bundler-1.0.10/lib/bundler/resolver.rb:349:in `resolve_requirement' | |
from c:/home/openeln/console-server/webapps/ROOT/WEB-INF/gems |
This file contains 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
Autotest.add_hook(:initialize) {|at| | |
# ... | |
# stop autotest from detecting changes in these files we don't care about | |
%w{.git .svn .hg .swp .DS_Store ._* tmp db log tmp vendor rerun.txt Gemfile.lock}.each do |exception| | |
at.add_exception(exception) | |
end | |
# ... |
This file contains 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
require 'autotest/growl' | |
require 'autotest/timestamp' | |
Autotest::Growl::clear_terminal = false | |
Autotest.add_hook(:initialize) {|at| | |
# at.clear_mappings # take out the default (test/test*rb) | |
# stop autotest from detecting changes in these files we don't care about | |
%w{.git .svn .hg .swp .DS_Store ._* tmp db log tmp vendor rerun.txt Gemfile.lock}.each do |exception| |
This file contains 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
# gems and thangs | |
require 'rest_client' | |
require 'json' | |
# go easy on the fingers | |
data_url = "http://hack4reno.socrata.com/api/views/gbbk-wygz/rows.json" | |
rc = RestClient | |
# we'll take anything right now | |
result = ask "", :choices => "[ANY]" |
This file contains 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
## Load this file in deploy.rb to use a GitHub style git-only deployment | |
## set useful variables | |
set(:latest_release) { fetch(:current_path) } | |
set(:release_path) { fetch(:current_path) } | |
set(:current_release) { fetch(:current_path) } | |
set(:current_revision) { capture("cd #{current_path}; git rev-parse --short HEAD").strip } | |
set(:latest_revision) { capture("cd #{current_path}; git rev-parse --short HEAD").strip } | |
set(:previous_revision) { capture("cd #{current_path}; git rev-parse --short HEAD@{1}").strip } |
This file contains 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 | |
require 'rexml/document' | |
include REXML | |
#open the XML file exported from Powerscribe | |
# Ruby lets us open the file in a block (thereby closing it when it's done) | |
File.open("Voice.xml") do |file| | |
# The "block" is that do ... end syntax and |file| is a reference to the file we've opened | |
doc = Document.new(file) |
This file contains 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/ruby | |
home_dir = ENV["HOME"] | |
ssh_dir = "#{home_dir.strip}/.ssh/*.pub" | |
puts "Checking #{ssh_dir} ..." | |
puts | |
Dir["#{home_dir.strip}/.ssh/*.pub"].each do |pk| | |
puts "Fingerprint for #{pk}" | |
fingerprint = `ssh-keygen -lf #{pk}` |