- Use best practices
- Minimal magic
- Elegant map/reduce/list management (with classes)
- Point out the best tools for validation and hooks
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
| module Registerable | |
| @@registered = {} | |
| class NotRegistered < StandardError; end | |
| def inherited(klass) | |
| klass.send(:indentifier, klass.name.downcase.to_sym) | |
| end | |
| def for(id, &block) |
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 UserSession < Authlogic::Session::Base | |
| class << self | |
| # Proxy through to the user model for formtastic | |
| def content_columns | |
| User.content_columns | |
| end | |
| end | |
| 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
| require 'rubygems' | |
| require 'mustache' | |
| class Template | |
| def read | |
| File.read("#{path}/my-template.mustache") | |
| end | |
| def path | |
| "templates" |
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
| db/couch/ | |
| |-- cultureamp | |
| `-- _design | |
| `-- stream | |
| |-- lists | |
| | `-- statuses | |
| | `-- list.js | |
| `-- views | |
| `-- statuses | |
| `-- map.js |
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 A | |
| class << self | |
| attr_writer :properties | |
| def property(name) | |
| (@properties||=[]) << name | |
| end | |
| def properties | |
| properties = [] | |
| ancestors.map do |elder| |
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
| CouchDB/HEAD/0.11b Homebrew recipe. | |
| -- You will need to run `brew link icu4c` prior to running the couchdb install. | |
| I've found `link` to not work under fish shell (it works under bash) so I'll | |
| need to dig into homebrew source to get that right. | |
| I'm just sharing it while I've got it ready. | |
| Save this file to your/homebrew/path/Library/Formulas/couchdb-head |
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
| git config --global alias.lg "log --date=relative --since='1 week ago' --pretty -… | |
| …-graph" |