Public Gists by heycarsten

Gravatar
Sat Nov 21 22:21:37 -0800 2009
1
2
3
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang='en' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'>
  <head>
Gravatar
Fri Oct 30 09:40:43 -0700 2009
1
2
3
module LCBO
  class SearchSuggest
 
Gravatar
Thu Oct 29 07:45:09 -0700 2009
1
2
3
require 'rubygems'
require 'benchmark'
require 'amatch'
Gravatar
Tue Sep 15 20:56:32 -0700 2009
1
2
3
# Some more pondering for my ScrapeKit normalizer builder. I keep throwing
# different use-cases at it which keeps causing me to change my design. I think
# I am starting to get to a happy place.
Gravatar
Sat Sep 12 11:39:59 -0700 2009
1
2
3
# Now all I have to do is make it work :-/
 
scraper do |doc|
Gravatar
Thu Sep 03 21:16:01 -0700 2009
1
2
3
# This is just a naive tree implementation, I couldn't find anything on Google
# that was instantly helpful, so I figured it out on my own. Turns out it was
# not too bad.
Gravatar
Mon Aug 24 09:24:46 -0700 2009
1
2
3
li { color: #f00; }
li span { color: #0f0; }
 
Gravatar
Wed Aug 05 14:09:31 -0700 2009
1
2
3
class Model < ActiveRecord::Base
 
  STATES = %w[ inactive active processing ]
Gravatar
Wed Jul 15 19:45:37 -0700 2009
1
2
3
=begin
  License: latest LGPL :D
 
Gravatar
Tue Jul 14 15:01:12 -0700 2009
1
2
3
document.observe('dom:loaded', function() {
  $$('input[tabindex="1"]').invoke('focus');
});
Gravatar
Wed Jul 01 11:29:23 -0700 2009
1
2
3
module FlashHelper
 
  # Will output all flashes in the FlashHash into DIV elements containing the
Gravatar
Tue Apr 21 23:02:38 -0700 2009
1
2
3
# /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.9.11/lib/dm-core/associations/relationship_chain.rb:49:in `initialize': undefined method `name' for nil:NilClass (NoMethodError)
# from /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.9.11/lib/dm-core/associations/one_to_many.rb:56:in `new'
# from /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.9.11/lib/dm-core/associations/one_to_many.rb:56:in `setup'
Gravatar
Wed Mar 18 12:41:45 -0700 2009
1
2
3
## application_controller.rb
 
def refresh_to(url, timeout = 10)
Gravatar
Sat Feb 21 23:29:59 -0800 2009
1
2
3
iPhone
------
8 GB - $655 / $199 with 3 year contract.
Gravatar
Mon Jan 19 10:49:36 -0800 2009
1
2
3
# You can override these if you want in environment initializers:
COUCHDB_HOST = 'http://127.0.0.1:5984' unless defined?(COUCHDB_HOST)
COUCHDB_DB_NAME = "learnhub_#{Rails.env}" unless defined?(COUCHDB_DB_NAME)
Gravatar
Fri Jan 16 11:26:15 -0800 2009
1
2
3
parse_git_branch() {
  RSLT=''
  GIT_BRANCH=`git branch 2> /dev/null | sed -e '/^[^*]/d' | awk '{print $2}'`
Gravatar
Tue Jan 13 22:38:08 -0800 2009
1
2
3
# Self-If-Self: A Study
#
# I have decided that this is silly, but I want to share it to see what other
Gravatar
Wed Jan 07 14:07:12 -0800 2009
1
2
3
require 'open-uri'
 
# First lets assign the results to a couple variables.
Gravatar
Wed Jan 07 13:13:54 -0800 2009
1
2
3
require 'open-uri'
labe = open("http://en.wikipedia.org/wiki/Labe").read
usa = open("http://en.wikipedia.org/wiki/USA").read
Gravatar
Tue Dec 16 18:57:46 -0800 2008
1
2
3
Rehearsal ----------------------------------------------------------------
Case Equality Operator 3.590000 0.970000 4.560000 ( 4.560098)
Object#is_a? Method 3.520000 0.970000 4.490000 ( 4.485853)