NOTE: This post now lives (and kept up to date) on my blog: http://hakunin.com/rails3-load-paths
Do nothing. All files in this dir are eager loaded in production and lazy loaded in development by default.
NOTE: This post now lives (and kept up to date) on my blog: http://hakunin.com/rails3-load-paths
Do nothing. All files in this dir are eager loaded in production and lazy loaded in development by default.
| class ValueObject < Struct | |
| def self.[](*args) | |
| if args.length > 0 | |
| new(*args) | |
| else | |
| new(:null) | |
| end | |
| end | |
| def [](*args) |
Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.
Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.
| class Account < ActiveRecord::Base | |
| def self.search(name = nil) | |
| # search logic | |
| end | |
| end |
| require "active_support/all" | |
| class Event | |
| STATES = %w(active archived) | |
| def self.types(&block) | |
| return to_enum(__callee__) unless block | |
| types = { |
| require 'github_api' | |
| require 'io/console' | |
| class Teams < Thor | |
| include Thor::Actions | |
| desc "ls", "list users in an organization" | |
| def ls(org) | |
| connenction = connect | |
| members = connenction.orgs.members.list org |
| #!/usr/bin/env sh | |
| if ! which md5sum > /dev/null; then | |
| echo Install md5sum | |
| exit 1 | |
| fi | |
| if ! which curl > /dev/null; then | |
| echo Install curl | |
| exit 1 |
| RSpec.configure do |config| | |
| config.before :suite do | |
| # set up a global cleaning strategy | |
| DatabaseCleaner.clean_with(:truncation) | |
| # AR specific strategy | |
| DatabaseCleaner[:active_record].strategy = :truncation | |
| # Explicitly tell DatabaseCleaner what connection is AR | |
| DatabaseCleaner[:active_record, connection: :pediafed_test] |
| # encoding : utf-8 | |
| require 'openssl' | |
| require 'digest/sha1' | |
| require 'base64' | |
| module Aws | |
| extend self | |
| def signed_url(path, expire_date) | |
| digest = OpenSSL::Digest::Digest.new('sha1') | |
| can_string = "GET\n\n\n#{expire_date}\n/#{S3_BUCKET}/#{path}" |
Locate the section for your github remote in the .git/config file. It looks like this:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = [email protected]:joyent/node.git
Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this: