This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class User | |
include MongoMapper::Document | |
key :name, String | |
# etc | |
many :addresses | |
end | |
class Address |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function returnimages($dirname="images") { | |
$pattern="\.(jpg|jpeg|png|gif|bmp)$"; | |
$files = array(); | |
if ($handle = opendir($dirname)) { | |
while (false !== ($file = readdir($handle))) { | |
$files[] = $file; | |
} | |
closedir($handle); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// I write this | |
body.about #work, body.contact #work { | |
width: 500px; | |
} | |
// But to make it "LESS" style | |
body.about { | |
#work { | |
width: 500px; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22:14 ~ $ cd src | |
22:14 ~/src $ cd code | |
22:14 ~/src/code $ cd rails | |
22:14 ~/src/code/rails (master)$ sudo rake install | |
Password: | |
(in /Users/garrett/src/code/rails) | |
(in /Users/garrett/src/code/rails/activesupport) | |
(in /Users/garrett/src/code/rails/activemodel) | |
(in /Users/garrett/src/code/rails/actionpack) | |
(in /Users/garrett/src/code/rails/actionmailer) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@import "reset"; | |
/** | |
* Wrapper | |
*/ | |
#wrapper { | |
background: url('../images/content/wrap.gif') repeat-x top; | |
width: 805px; | |
margin: 0 auto; padding: 10px; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($) { | |
var cache = []; | |
$.preloadImages = function() { | |
$(arguments).each(function (i) { | |
cache.push($('<img>', { 'src': arguements[i] })); | |
}); | |
} | |
})(jQuery); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use Bundler (preferred) | |
environment = File.expand_path('../../vendor/gems/environment', __FILE__) | |
if File.exist?("#{environment}.rb") | |
require environment | |
else | |
vendor_rails = File.expand_path('../../vendor/rails', __FILE__) | |
if File.exist?(vendor_rails) | |
Dir["#{vendor_rails}/*/lib"].each { |path| $:.unshift(path) } | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def post_process #:nodoc: | |
return if @queued_for_write[:original].nil? | |
# This line below causes the first line of fire_events to return true, which stops the post_process_styles | |
# I can't figure out what before_post_process does | |
return if fire_events(:before) | |
post_process_styles | |
return if fire_events(:after) | |
end | |
def fire_events(which) #:nodoc: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
directory "/Users/garrett/src/sites/GB", :glob => "{*/,}*.gemspec" | |
git "git://github.com/rails/arel.git" | |
git "git://github.com/rails/rack.git" | |
gem "rails", :git => "git://github.com/rails/rails.git" | |
gem "paperclip", :git => "git://github.com/thoughtbot/paperclip.git", :branch => "rails3" | |
gem "authlogic", :git => "git://github.com/binarylogic/authlogic.git" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
directory "/Users/garrett/src/sites/GB", :glob => "{*/,}*.gemspec" | |
git "git://github.com/rails/arel.git" | |
git "git://github.com/rails/rack.git" | |
gem "rails", :git => "git://github.com/rails/rails.git" | |
gem "paperclip", :git => "git://github.com/thoughtbot/paperclip.git", :branch => "rails3" | |
gem "authlogic", :git => "git://github.com/binarylogic/authlogic.git" |