Skip to content

Instantly share code, notes, and snippets.

View mferrier's full-sized avatar

Mike Ferrier mferrier

View GitHub Profile
require 'rubygems'
require 'active_support'
# >> class Foo
# >> include LogMethodCalls
# >> log_methods :bar, :say, :one_plus, :do_something
# >>
# ?> def bar; puts "bar"; end
# >> def say(something); puts something; end
# SQLite version 3.x
# gem install sqlite3-ruby (not necessary on OS X Leopard)
development:
adapter: sqlite3
database: db/development.sqlite3
pool: 5
timeout: 5000
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
$ irb
>> if false
>> poop = true
>> end
=> nil
>> defined?(poop)
=> "local-variable"
>> poop
=> nil
ELEMENTPARSER DEBUG OUTPUT
2009-09-27 22:01:06.824 ljapp[96752:20b] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2009-09-27 22:01:06.825 ljapp[96752:20b]
2009-09-27 22:01:06.825 ljapp[96752:20b] <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
ELEMENTPARSER DEBUG OUTPUT
2009-09-27 22:01:06.824 ljapp[96752:20b] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2009-09-27 22:01:06.825 ljapp[96752:20b]
2009-09-27 22:01:06.825 ljapp[96752:20b] <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
ELEMENTPARSER DEBUG OUTPUT
2009-09-27 22:01:06.824 ljapp[96752:20b] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2009-09-27 22:01:06.825 ljapp[96752:20b]
2009-09-27 22:01:06.825 ljapp[96752:20b] <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
# Return the current path with its query parameters, merging the passed parameters over any existing ones
# Include an :exclude key to remove the named existing parameter keys before merging
#
# Examples:
#
# # From http://localhost:3000/ncaab
# current_path_with_merged_parameters(:offset => 1)
# => "/ncaab?offset=1"
#
# # From http://localhost:3000/ncaab?offset=1
>> date = Date.parse("nov 2, 2009")
=> Mon, 02 Nov 2009
>> start = Time.parse("2009-11-1T20:20")
=> Sun Nov 01 20:20:00 -0500 2009
>> start > date
=> true
<foo>
<bar></baz>
@mferrier
mferrier / local.zone
Created April 4, 2011 22:21
local zone file
$TTL 60
$ORIGIN local.
@ 1D IN SOA localhost. root.localhost. (
45 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
1D IN NS localhost.