My Recent Pastes (84 and counting)

Pastes by Henrik Nyh (84 and counting)

Pages:

Below are the 15 most recent pasties by Henrik Nyh.

October 10, 2007
2:01PM EDT
by Henrik Nyh

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

# 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

# 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

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

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

# This file goes in e.g. vendor/plugins/example/test.
# Assuming edge Rails.

# test helper:

August 16, 2007
5:58PM EDT
by Henrik Nyh

namespace :foo do
  
  desc 'Does this.'
  task :bar => [:baz] do
    puts "mextra"

August 16, 2007
5:57PM EDT
by Henrik Nyh

namespace :foo do
  
  desc 'Does this.'
  task :bar do
    puts "extra"

August 12, 2007
4:49AM EDT
by Henrik Nyh

--- polymorphic_routes.rb (saved version)
+++ (current document)
@@ -13,7 +13,7 @@
 
       inflection =

August 11, 2007
3:12AM EDT
by Henrik Nyh

echo "✓ $TM_LINE_INDEX"
echo "- $TM_LINE_INDEX"

August 08, 2007
1:49PM EDT
by Henrik Nyh

X
  X
foo X

July 27, 2007
6:06PM EDT
by Henrik Nyh

--- 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
1:54PM EDT
by Henrik Nyh

            __   __
           __ \ / __
          /  \ | /  \
              \|/
         _,.---v---._

July 25, 2007
11:25AM EDT
by Henrik Nyh

{        scopeName = 'source.ruby';
        comment = '
        TODO: unresolved issues

        text:

Next page