Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View dallas's full-sized avatar

Dallas Reedy dallas

View GitHub Profile
@dallas
dallas / easy_columns.css
Created August 13, 2009 17:10
thoughts on CSS columnar grids in TextMate
/* Need to make a columnar CSS layout (for a 960-grid, say)?
Have a fixed width base to work off of (like 960 pixels)?
Want it in all kinds of sizes (2,3,4,5,6,8,10 & 12, say)?
Then this is the snippet for you!
In TextMate, you can just select all
of the following lines and press:
Ctrl + Shift + E (evaluate as ruby).
This snippet is based on a 960px base,
@dallas
dallas / html_examples.html
Created August 10, 2009 20:44
HTML elements—like, all of 'em
<!-- Got this from inside the gridz_app files
http://github.com/tschmidt/gridz_app
Other than that, I don't know where it's from, but I like it! -->
<h1>This document shows various HTML elements</h1>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit Lorem ipsum dolor sit amet, volutpat. </p>
<h2>This is 2nd level heading bh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi luptatum zzril delenit Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam no</h2>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. </p>
@dallas
dallas / to_word.rb
Created August 9, 2009 04:26
implementation of Integer#to_word
class Integer
@@singles ||= ['zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine']
@@teens ||= ['ten', 'eleven', 'twelve', 'thirteen', '', 'fifteen']
@@tens ||= ['', '', 'twenty', 'thirty', 'forty', 'fifty', 'sixty', 'seventy', 'eighty', 'ninety']
@@places ||= [ 'hundred', 'thousand', 'million', 'billion', 'trillion', 'quadrillion', 'quintillion',
'sextillion', 'septillion', 'octillion', 'nonillion', 'decillion', 'undecillion',
'duodecillion', 'tredecillion', 'quattuordecillion', 'quindecillion', 'sexdecillion',
'septendecillion', 'octodecillion', 'novemdecillion', 'vigintillion'] # etc.
# (QUICKLY) Converts a number into English words.
@dallas
dallas / rails_template.rb
Created July 8, 2009 21:29 — forked from henrik/rails_template.rb
Rails template for v2.3 by henrik
# Rails template for Rails 2.3. Work in progress.
# By Henrik Nyh (http://henrik.nyh.se) 2009-03-29. Public domain.
# Usage: rails myapp -m http://gist.github.com/87341.txt
META_AUTHOR = "Henrik Nyh (http://henrik.nyh.se)"
JQUERY_VERSION = "1.3.2"
APP_NAME = File.basename(Dir.pwd)
git :init
@dallas
dallas / try.rb
Created July 8, 2009 21:24 — forked from CodeOfficer/try.rb
TryProxy by CodeOfficer from heypanda.com
# courtesy of http://heypanda.com/
class TryProxy
def initialize(receiving_object)
@receiving_object = receiving_object
end
def method_missing(meth, *args, &block)
@receiving_object.nil? ? nil : @receiving_object.send(meth, *args, &block) rescue nil
end
@dallas
dallas / syntax highlighting for Rails builders in TextMate
Created June 24, 2009 23:42
Syntax highlighting for Rails builders in TextMate (add to the Ruby on Rails language)
# This is now part of the Ruby on Rails bundle in my textmate_paraphernalia repository
{ match = '(\b(xml|css)\b\.)(\b\w+\b!?)?';
captures = {
2 = { name = 'variable.other.builder.rails'; };
3 = { name = 'function.other.builder.rails'; };
};
},