Skip to content

Instantly share code, notes, and snippets.

Dallas Reedy dallas

Block or report user

Report or block dallas

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@dallas
dallas / easy_columns.css
Created Aug 13, 2009
thoughts on CSS columnar grids in TextMate
View easy_columns.css
/* 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 Aug 10, 2009
HTML elements—like, all of 'em
View html_examples.html
<!-- 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 Aug 9, 2009
implementation of Integer#to_word
View to_word.rb
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 Jul 8, 2009 — forked from henrik/rails_template.rb
Rails template for v2.3 by henrik
View rails_template.rb
# 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 Jul 8, 2009 — forked from CodeOfficer/try.rb
TryProxy by CodeOfficer from heypanda.com
View try.rb
# 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 Jun 24, 2009
Syntax highlighting for Rails builders in TextMate (add to the Ruby on Rails language)
View syntax highlighting for Rails builders in TextMate
# 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'; };
};
},
You can’t perform that action at this time.