Skip to content

Instantly share code, notes, and snippets.

def is_awesome?
name == 'Shay Arnett'
end
javascript:var parts=location.pathname.split('/');location.href='http://twictur.es/' + parts[parts.length-1] + '.gif';
#!/usr/bin/ruby
__DIR__ = File.join(File.dirname(__FILE__),"..")
framework = File.join(__DIR__,"framework")
if File.directory?(framework)
puts "Running from frozen framework"
core = File.join(framework,"merb-core")
if File.directory?(core)
diff --git a/lib/merb-core/controller/mixins/controller.rb b/lib/merb-core/controller/mixi
index 81e5e39..a8ae923 100644
--- a/lib/merb-core/controller/mixins/controller.rb
+++ b/lib/merb-core/controller/mixins/controller.rb
@@ -125,7 +125,7 @@ module Merb
# redirect("http://www.merbivore.com/")
# redirect("http://www.merbivore.com/", :permanent => true)
def redirect(url, opts = {})
- default_redirect_options = { :message => nil, :permanent => false }
+ default_redirect_options = { :message => message.empty? ? nil : message ,:permanent
#make dock really really small
defaults write com.apple.dock tilesize -int 1
diff --git a/center.applescript b/center.applescript
index 3049271..0dc2ec1 100644
--- a/center.applescript
+++ b/center.applescript
@@ -44,7 +44,7 @@ tell application "System Events"
on error
set {w, h} to {0, 0}
end try
- set position of window 1 to {((screen_width - windowWidth) / 2), ((screen_height - windowHeight) / 2.0) -
+ set position of window 1 to {(((screen_width - windowWidth) / 2) + w), ((screen_height - windowHeight) / 2
need a test for embedding
require 'rubygems'
require 'open-uri'
vids = []
f = open('http://feeds.feedburner.com/Rubyconf2008-Confreaks')
f.each do |l|
l =~ /enclosure url=\"([^\"]+)"/
vids << $1
end
vids.compact!.uniq!
<%= form_for @product, :action => url(:product,@product) do %>
<% end =%>
require 'open-uri'
require 'test/unit'
class WhenDoITest < Test::Unit::TestCase
def test_all_the_fucking_time
body = open("http://whendoitest.com").read
assert_match(/All The Fucking Time/,body)
end
end