My Recent Pastes (84 and counting)
Pastes by Henrik Nyh (84 and counting)
Below are the 15 most recent pasties by Henrik Nyh.
October 10, 2007
2:01PM EDT
by Henrik Nyh
View all 49 lines
def swf_object(path, args = {}, &block)
required_arguments = [:url, :id, :width, :height, :version]
optional_arguments = [:express_install_url]
hash_arguments = [:flashvars, :params, :attributes]
October 06, 2007
5:03PM EDT
by Henrik Nyh
View all 32 lines
# Makes ActiveRecord raise when an attempt is made to mass-assign an attribute # protected by attr_protected/attr_accessible, instead of silently leaving that # attribute unchanged. This makes it far easier to spot dud assignments. # # In production, the error is logged, not raised, since the end user shouldn't
October 05, 2007
3:19PM EDT
by Henrik Nyh
View all 30 lines
# Makes ActiveRecord raise when an attempt is made to mass-assign an attribute # protected by attr_protected/attr_accessible, instead of silently leaving that # attribute unchanged. This makes it far easier to spot dud assignments. # # In production, the error is logged, not raised, since the end user shouldn't
September 10, 2007
7:00PM EDT
by Henrik Nyh
View all 21 lines
class Foo
def bar
puts "default receiver!"
end
private :bar
September 01, 2007
5:26PM EDT
by Henrik Nyh
A = Struct.new(:tt, :text, :beg)
p A.new("foo", "bar", "baz") # => #<struct A tt="foo", text="bar", beg="baz">
August 25, 2007
7:11PM EDT
by Henrik Nyh
View all 32 lines
require File.join(File.dirname(__FILE__), 'ptk_helper') require 'test_help' # For integration tests class FoosController < ActionController::Base def index
August 25, 2007
3:02PM EDT
by Henrik Nyh
View all 47 lines
# This file goes in e.g. vendor/plugins/example/test. # Assuming edge Rails. # test helper:
August 16, 2007
5:58PM EDT
by Henrik Nyh
View all 8 lines
namespace :foo do
desc 'Does this.'
task :bar => [:baz] do
puts "mextra"
August 16, 2007
5:57PM EDT
by Henrik Nyh
View all 10 lines
namespace :foo do
desc 'Does this.'
task :bar do
puts "extra"
August 12, 2007
4:49AM EDT
by Henrik Nyh
View all 11 lines
--- polymorphic_routes.rb (saved version)
+++ (current document)
@@ -13,7 +13,7 @@
inflection =
July 27, 2007
6:06PM EDT
by Henrik Nyh
View all 11 lines
--- revert_file.rb (saved version)
+++ (current document)
@@ -31,7 +31,7 @@
# TextMate::UI.alert(:warning, "¿Que pasa?", "It's not dangerous to revert the file “#{paths_for_shell.inspect}”.")
July 25, 2007
11:25AM EDT
by Henrik Nyh
View all 954 lines
{ scopeName = 'source.ruby';
comment = '
TODO: unresolved issues
text:
