Start a breakable toy:
- A Rails app.
- Something you're passionate about.
- Work on it every week.
- Stick to a style guide.
- Push the code to Github.
| #!/usr/bin/env ruby | |
| require 'open-uri' | |
| require 'nokogiri' | |
| require 'json' | |
| class Repo | |
| def initialize(name) | |
| @name = name | |
| end |
| # lib/image_validator.rb | |
| module ImageValidator | |
| def validates_image(attr_name) | |
| validates_attachment_presence attr_name | |
| validates_attachment_content_type attr_name, | |
| :content_type => Settings.paperclip.image_content_types | |
| validates_attachment_size attr_name, :in => 1..1.megabyte | |
| end | |
| end |
| FIREFOX_FIXTURES = [ | |
| { | |
| browser: 'Firefox', | |
| gecko_version: '20101203', | |
| os: 'Intel Mac OS X 10.6', | |
| platform: 'Macintosh', | |
| raw: 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13', | |
| version: '3.6.13' | |
| }, | |
| { |
Start a breakable toy:
| { | |
| :stylish => "%l%P, %B %d", # 9am, April 13 | |
| :long_date => "%a, %b %d, %Y", # Fri, Apr 13, 1982 | |
| :longer_date => "%B %d, %Y %H:%M %Z", # April 13, 1982 9:18 | |
| :classy => "%B %d, %Y - %I:%M %p", # April 13, 2010 - 9:18am | |
| :index => "%Y/%m/%d %H:%M", # 1982/04/13 9:18 | |
| :birthdate => "%a, %b %d, %Y", # Friday, Apr 13, 1982 | |
| :standard => "%B %d, %Y", # April 13, 1982 | |
| :abbr_month => "%b", # Apr | |
| :abbr_month_day => "%b %d", # Apr 13 |
Periodically use pgbackups to pull latest production data.
Merge master into staging
git checkout master
git reset --hard origin/master
git pull
git checkout staging
git reset --hard origin/staging
Use the latest version of the copycopter_client gem:
gem 'copycopter_client', '2.0.0'
Export your published drafts from copycopter.com:
RAILS_ENV=production bundle exec rake copycopter:export
This will create a config/locales/copycopter.yml file.
| module SingleRecipientSmtp | |
| def self.included(clazz) | |
| clazz.class_eval do | |
| cattr_accessor :single_recipient_smtp_settings | |
| end | |
| end | |
| def perform_delivery_single_recipient_smtp(mail) | |
| mail.to = single_recipient_smtp_settings[:to] | |
| mail.cc = nil |