Skip to content

Instantly share code, notes, and snippets.

View kibaekr's full-sized avatar

Keith Ryu kibaekr

  • Fountain
  • San Francisco, CA
View GitHub Profile
anonymous
anonymous / Problem
Created February 25, 2013 05:08
Track.last.authors => works
Track.last.original_author => doesn't work
User.last.creations => works
User.last.original_creations => doesn't work.
I'm still a beginner and not entirely sure how the relationships work, and which words need to match. For example, does "author" need to match in "belongs_to :author" from Track_Author with "has_many :authors" from Track.rb?
@adamwiggins
adamwiggins / adams-heroku-values.md
Last active November 5, 2024 21:40
My Heroku values

Make it real

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.

Ship 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.

Do it with style

@sabril
sabril / aws_setup.md
Last active December 31, 2015 21:59 — forked from rudylee/digitalocean.md

Deploy Rails app to digitalocean/amazon EC2 with nginx, unicorn, capistrano, sidekiq & postgres

Create droplet of your liking (ubuntu 12.10 x32)

ssh to root in terminal with your server ip

ssh -i config/onvard.pem [email protected]

Add ssh fingerprint and enter password provided in email

class Api::V1::BaseController < ApplicationController
respond_to :json
before_action :authenticate! #make this the default, then you could use skip_before_action on an action you don't need it
def authenticate!
load_account || access_denied
end
def access_denied
Authentication: pass your api token in the 'X-ACCESS-TOKEN' request header, or in the 'api_token' parameter
Create a user
POST
onboardiq.com/api/v1/applicants
Required attributes: [name, email, phone]
Email must be valid and unique
require "test_helper"
describe Phase do
before do
# Timecop.travel computes an offset between what we currently think Time.now is (recall that we support nested traveling) and the time passed in.
# joe = User.find(1)
# joe.purchase_home()
# assert !joe.mortgage_due?
# # move ahead a month and assert that the mortgage is due
# Timecop.freeze(Time.now.to_date + 30) do
@johnmeehan
johnmeehan / sublimetext3_terminal_link.sh
Last active August 29, 2015 14:11
Open Sublime Text 3 from Terminal in OSX Yosemite