Public Gists by kastner

Gravatar
Fri Oct 30 07:33:58 -0700 2009
1
2
3
module Rack
  # Apache and others set HTTP_X_FORWARDED_HOST for proxied connections
  # This middleware detects it and makes it look like the HOST
Gravatar
Thu Oct 29 21:57:21 -0700 2009
1
2
3
# Lo-fi client for the Facebook API. E.g.:
#
# fb = FacebookClient.new(:api_key => 'api-key', :secret => 'secret')
Gravatar
Mon Oct 19 14:45:49 -0700 2009
1
2
3
#!/usr/bin/env ruby
#####################################################################################
# Extract images from Saks
Gravatar
Thu Oct 15 12:24:59 -0700 2009

      
Gravatar
Thu Oct 15 12:22:09 -0700 2009

      
Gravatar
Sun Oct 11 19:49:12 -0700 2009
1
2
3
Sinatra+Mustache Partial Madness
================================
 
Gravatar
Tue Oct 06 21:19:52 -0700 2009
1
2
3
diff --git a/app/models/asset.rb b/app/models/asset.rb
index 19a5d0c..a3177ba 100644
--- a/app/models/asset.rb
Gravatar
Wed Sep 30 21:04:02 -0700 2009
1
2
3
#!/usr/bin/env ruby -wKU
 
def replace(char)
Gravatar
Sun Sep 27 20:20:43 -0700 2009
1
2
3
diff --git a/app/controllers/assets_controller.rb b/app/controllers/assets_controller.rb
index 913af3c..d136fcd 100644
--- a/app/controllers/assets_controller.rb
Gravatar
Fri Sep 25 18:23:15 -0700 2009
1
(__)__)=========D ~ ~ (__☼__)
Gravatar
Tue Sep 15 12:11:01 -0700 2009
1
2
3
#!/usr/bin/env ruby
%w|rubygems active_record irb|.each {|lib| require lib}
class Vendor < ActiveRecord::Base
Gravatar
Wed Sep 09 12:46:19 -0700 2009
1
2
3
require 'httparty'
 
class Etsy
Gravatar
Sun Aug 30 08:29:14 -0700 2009
1
2
3
require 'rubygems'
require 'context'
require 'matchy'
Gravatar
Wed Aug 26 14:18:36 -0700 2009
1
2
3
Poor Man's Deploy
=================
 
Gravatar
Mon Jul 06 13:13:06 -0700 2009
1
2
3
#!/usr/bin/env ruby
%w|rubygems active_record irb|.each {|lib| require lib}
 
Gravatar
Mon Jul 06 05:25:05 -0700 2009
1
2
3
caption always "%m/%d/%y %0c%{=b kW} %-Lw%{= bd}%50>%n%f* %t%{-}%<%+Lw"
startup_message off
autodetach on
Gravatar
Thu Jun 25 14:04:49 -0700 2009
1
2
3
class BooksController < ApplicationController
  rescue_from ActiveRecord::RecordNotFound, :with => :book_not_found
  
Gravatar
Sun Jun 21 09:59:50 -0700 2009
1
2
3
module ActiveSupport
  module Testing
    module Declarative
Gravatar
Tue Jun 09 15:25:02 -0700 2009
1
2
3
<% content_tag_for :ul, @books do %>
  <% @books.each do |book| %>
    <% content_tag_for :li, book do %>
Gravatar
Sun Jun 07 09:23:16 -0700 2009
1
Every system is built from a domain-specific language designed by the programmers to describe that system. Functions are the verbs of that language, and classes are the nouns. This is not some throwback to the hideous old notion that the nouns and verbs in a requirements document are the first guess of the classes and functions of a system. Rather this is a much older truth. The art of programming is, and has always been, the art of language design.