Public Gists by toolmantim

Gravatar
Sat Sep 26 23:56:54 -0700 2009
1
2
3
# To be stuck in the top of your Sinatra app or whichever file you want to
# declare the gems.
#
Gravatar
Sat Sep 26 23:24:37 -0700 2009
1
2
3
namespace :gems do
  desc "Install missing gem dependencies"
  task :install do
Gravatar
Mon Sep 21 05:58:47 -0700 2009
1
2
3
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
 
Gravatar
Thu Aug 27 18:24:36 -0700 2009
1
2
3
// Adds controller methods to elements
$$ = function(elem, methods) {
  if (methods) $(elem).data("controller", methods);
Gravatar
Thu Aug 20 05:33:38 -0700 2009
1
# Some fish things for @markryall
Gravatar
Mon May 25 21:26:24 -0700 2009
1
2
3
#header
 
  .state{:title => "Not Logged in"}
Gravatar
Fri May 08 23:17:51 -0700 2009
1
2
3
# An example of the simplest possible Capfile. Useful for redeploying small
# apps hosted with mod_rails. It doesn't import the standard cap recipes
# (such as setting up the app on the server) it simply handles redeployment.
Gravatar
Wed May 06 23:57:57 -0700 2009
1
2
3
#!/usr/bin/env ruby
require 'rubygems'
 
Gravatar
Wed May 06 08:29:17 -0700 2009
1
2
3
# Chuck this in config/initializers for view-first validations
ActionView::Base.default_form_builder.class_eval do
  def error(field)
Gravatar
Wed May 06 08:26:06 -0700 2009
1
2
3
# Example of simplifying Cucumber stories by assuming you can read simple Ruby structures
#
# Used in my presentation:
Gravatar
Sat May 02 21:23:16 -0700 2009
1
2
3
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
Gravatar
Sat May 02 00:02:59 -0700 2009
1
2
3
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang='en-US' xml:lang='en-US' xmlns='http://www.w3.org/1999/xhtml'>
  <head>
Gravatar
Wed Mar 04 20:04:39 -0800 2009
1
2
              %a{:href => name, :class => (@category == name ? "selected" : nil)}
                %span= name
Gravatar
Sun Mar 01 21:26:49 -0800 2009
1
2
3
HoptoadNotifier.configure do |config|
  config.environment = RAILS_ENV
  config.application_root = RAILS_ROOT
Gravatar
Sun Mar 01 21:16:30 -0800 2009
1
2
3
# Example of using Hoptoad from a Sinatra app.
#
# This uses the existing Rails plugin with a hacky workaround for RAILS_ENV
Gravatar
Thu Feb 26 18:39:41 -0800 2009
1
2
3
# Improving cucumber output
 
We want to reduce cucumber's signal to noise ratio--currently errors are
Gravatar
Tue Feb 17 01:50:03 -0800 2009
1
2
3
# Example simple stupid in-memory cache
class HashCache
  def initialize(seconds_timeout)
Gravatar
Thu Dec 25 19:36:09 -0800 2008
1
2
3
# Why build a site? Why do your customers care?
 
The core purpose of a website is to help your customers answer the questions necessary to do business with you.
Gravatar
Thu Dec 18 17:20:00 -0800 2008
1
2
3
# Downloads all the photos from a flickr set
 
require 'open-uri'
Gravatar
Thu Oct 23 16:27:21 -0700 2008
1
2
3
class CuratorialContentFinder
  include SemiAutomated
  include CuratorialContentFinderFinder