This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
map.resources :divisions do |division| | |
division.resources :wss_configs | |
division.resources :websites | |
division.resources :urls | |
division.resources :announcements | |
division.resources :attachments | |
division.resources :scenes | |
end | |
map.resources :articles, :has_many => [:comments], do |article| |
class Show | |
has_many :scenes | |
end | |
class Scene | |
has_one :scenable :as => :scenable | |
end | |
class Announcement | |
belongs_to :scenable, :polymorphic => true |
# Hook our MongoMapper model into Solr | |
module MongoAdapter | |
class InstanceAdapter < Sunspot::Adapters::InstanceAdapter | |
def id | |
@instance.id | |
end | |
end | |
class DataAccessor < Sunspot::Adapters::DataAccessor | |
def load(id) |
connection = Faraday::Connection.new('http://example.com') do |builder| | |
builder.request :url_encoded # for POST/PUT params | |
builder.adapter :net_http | |
end | |
# same as above, short form: | |
connection = Faraday.new 'http://example.com' | |
# GET | |
connection.get '/posts' |
#!/usr/bin/env ruby | |
# To use this: | |
# * Set up the jshint Gem with your Rails app: https://github.com/liquid/jshint_on_rails | |
# * Copy this file to [YOURPROJECT]/.git/hooks/pre-commit | |
# * chmod 0755 .git/hooks/pre-commit | |
files_changed = `git diff --name-only HEAD` | |
if files_changed.any? { |line| line =~ %r|public/javascripts| } | |
puts "Running jshint to check changes to javascript ..." |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
Chances are your head's spinning right now. That accusation of bias caught you off guard, you got kind of defensive, and now all hell has broken loose. You're feeling attacked on all sides. You're a good person at heart, and having all these people treat you like the antichrist is pretty upsetting.
You need to say something, but you're probably not in the best headspace to write copy right now. So to help you along, here's my 100% guaranteed-or-you-money-back scandal defusement apology template:
source "https://rubygems.org" | |
gem 'mechanize' | |
gem 'twitter' |