Skip to content

Instantly share code, notes, and snippets.

Adrian Duyzer adriand

Block or report user

Report or block adriand

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
View gist:10890369
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
View gist:9353194
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.
View Monokai.dvtcolortheme
<?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>
You can’t perform that action at this time.