Skip to content

Instantly share code, notes, and snippets.

View bousquet's full-sized avatar

Robert Bousquet bousquet

View GitHub Profile
@bousquet
bousquet / gist:38449825ee21d3fea098
Last active April 30, 2017 21:17
REST API Design Doc

REST API Design Doc

Base URL

Each version of the API should remain functional for a period of time after the next version is released to allow client applications time to migrate to the next version. Typically this is done by placing a version number in a query parameter ?version=20151201. If no version is provided, the latest API version will be assumed.

https://company.com/api/

Authentication

class User < ActiveRecord::Base
has_many :collection_tracks
has_many :tracks, through: :collection_tracks
def collection
tracks
end
def add_to_collection(track)
collection_tracks.where(track_id: track.id).first_or_create
@bousquet
bousquet / fortune1000.csv
Created September 19, 2012 07:57
Fortune 1000 List - circa 2009
rank name domain
1 Exxon Mobil exxonmobil.com
2 Wal-Mart Stores corporate.walmart.com
3 Chevron chevron.com
4 ConocoPhillips conocophillips.com
5 General Electric ge.com
6 General Motors gm.com
7 Ford Motor ford.com
8 AT&T att.com
9 Hewlett-Packard hp.com