Skip to content

Instantly share code, notes, and snippets.

// Is there a better way when using call from href?
$(document).ready(function() {
$.extend($.facebox.settings, {inited: false});
$(document).bind('init.facebox', function() {
$('#facebox .close_image').hide();
});
}):
require "benchmark"
TIMES = (ARGV[0] || 1_000_000).to_i
class A
def to_s
"foo"
end
end
class MyMailerClassTest < ActionMailer::TestCase
def test_should_render_special_template_under_circumstance
mailer = MyMailerClass.send(:new, 'mailer_method') # new('mailer_method') is a short cut for new.create!('mailer_method')
assert_equal 'special_template.html.erb', mailer.template
end
end
javascript:u=window.location.href.split(/\//);r=u[3]+'/'+u[4];s=prompt('Github Code Search ('+r+')');if(s==null)return;q=s+' repo:'+r;window.location.href='http://github.com/search?q='+q
# spec/spec_helper in waves project
require 'rubygems'
require 'waves'
require 'runtime/console'
require 'spec'
Waves::Console.load(:mode => 'test')
require File.expand_path(File.dirname(__FILE__) + '/../configurations/test')
Spec::Runner.configure do |config|
dumont:~ ryanbriones$ /usr/bin/curl -i -F 'login=ryanbriones' -F 'token=[REDACTED]' https://github.com/api/v1/json/ryanbriones/[REDACTED]/commits/master
(*
Open New Webkit Window.scpt
Open a new Webkit window in the current space
Used in conjunction with Quicksilver
*)
tell application "System Events"
if (count (processes whose name is "Webkit")) is 1 then
tell application "WebKit" to make new document
end if
(*
Open New Terminal Window.scpt
Open a new Terminal window in the current space
Used in conjunction with Quicksilver
*)
tell application "System Events"
if (count (processes whose name is "Terminal")) is 1 then
tell application "Terminal" to do script ""
end if
# db:migrate:reset was doing nothing for me against (jruby) jdbc/oracle.
# added this task, and all is well with the world.
# written for Rails 2.2
namespace :db do
task :drop do
unless defined? RAILS_ENV
RAILS_ENV = ENV['RAILS_ENV'] ||= 'development'
end
Spec::Rake::SpecTask.new do |t|
t.spec_files = FileList['spec/**/*_spec.rb', 'app/shared/spec/**/*_spec.rb']
end