Skip to content

Instantly share code, notes, and snippets.

View adriand's full-sized avatar

Adrian Duyzer adriand

  • Hamilton, Ontario
View GitHub Profile
@adriand
adriand / Monokai.dvtcolortheme
Created August 9, 2012 17:41 — forked from kristoferjoseph/Monokai.dvtcolortheme
Molokai theme for XCode4
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>DVTConsoleDebuggerInputTextColor</key>
<string>0.995968 0.995968 0.995968 1</string>
<key>DVTConsoleDebuggerInputTextFont</key>
<string>Inconsolata - 16.0</string>
<key>DVTConsoleDebuggerOutputTextColor</key>
<string>0.995968 0.995968 0.995968 1</string>
Ruby/Rails
- Use latest stack (Ruby 2.1.x, Rails 4.x, Postgresql)
- Prefer the new hash syntax, but use the old one when necessary (ie. when you need to use strings as keys)
- Code in ActiveRecord models should pertain directly to storing or retrieving data
- Use Draper to decorate model instances and test your decorators with RSpec (app/decorators is the place for this)
- Put business logic into service classes and test them with RSpec (app/services is a fine place for this, you can get more specific if your services folder gets fat)
- I like to name my service classes after what they do, or give them cute names occasionally (AddsProductstoCart or CartStuffer)
- Don’t hesitate to namespace related models or services into modules.
- Use Resque and Redis for background job handling.
Ruby/Rails
- Use latest stack (Ruby 2.1.x, Rails 4.x, Postgresql)
- Prefer the new hash syntax, but use the old one when necessary (ie. when you need to use strings as keys)
- Code in ActiveRecord models should pertain directly to storing or retrieving data
- Use Draper to decorate model instances and test your decorators with RSpec (app/decorators is the place for this)
- Put business logic into service classes and test them with RSpec (app/services is a fine place for this, you can get more specific if your services folder gets fat)
- I like to name my service classes after what they do, or give them cute names occasionally (AddsProductstoCart or CartStuffer)
- Don’t hesitate to namespace related models or services into modules.
- Use Resque and Redis for background job handling.
- Testing should be the rule, not the exception