Skip to content

Instantly share code, notes, and snippets.

View isaacsanders's full-sized avatar

Isaac Sanders isaacsanders

View GitHub Profile
@isaacsanders
isaacsanders / Equity.md
Created January 21, 2012 15:32
Joel Spolsky on Equity for Startups

This is a post by Joel Spolsky. The original post is linked at the bottom.

This is such a common question here and elsewhere that I will attempt to write the world's most canonical answer to this question. Hopefully in the future when someone on answers.onstartups asks how to split up the ownership of their new company, you can simply point to this answer.

The most important principle: Fairness, and the perception of fairness, is much more valuable than owning a large stake. Almost everything that can go wrong in a startup will go wrong, and one of the biggest things that can go wrong is huge, angry, shouting matches between the founders as to who worked harder, who owns more, whose idea was it anyway, etc. That is why I would always rather split a new company 50-50 with a friend than insist on owning 60% because "it was my idea," or because "I was more experienced" or anything else. Why? Because if I split the company 60-40, the company is going to fail when we argue ourselves to death. And if you ju

@isaacsanders
isaacsanders / api.feature
Created February 17, 2012 01:38
RESTful API example
Feature: RESTful JSON Pages API
In order to interact with my information in different stacks
I want to interact with a RESTful JSON API.
Scenario: GET /api/pages
Given I have pages in my database
When I make an HTTP GET request to /api/pages
Then I see a JSON array of pages
Scenario: POST /api/pages
@isaacsanders
isaacsanders / OrgRepoCommitSort
Created March 8, 2012 21:59
OrgRepoCommitSort
First get a list of repos from https://api.github.com/orgs/{{organizationName}}/repos
Then get a list of commits for each repo from https://api.github.com/repos/{{organizationName}}/{{repoName}}/commits
For each commit in the array of commits, commit.commit.author.date will be the date the author commited it in their repo.
From there it is sorting to get the newest.
@isaacsanders
isaacsanders / :D
Created March 18, 2012 18:12
This is a test gist
klsdlkjsdfkljsd
asdflksdl;ksdfjklsdf
sdfkasdkl;asdkljsdfjkl;sdf;kljdd
@isaacsanders
isaacsanders / bad_code.rb
Created March 19, 2012 16:35
Acceptance Criteria for Dead Commented Code Deleter
# This is for stuff that can't be deleted
@isaacsanders
isaacsanders / shell.rb
Created March 23, 2012 13:19
Very simple shell
while true
print '$ '
cmd = gets
system(cmd)
end
@isaacsanders
isaacsanders / gist_spec.rb
Created April 11, 2012 14:30
This is a spec file on my Githubris project. Note the specific tests.
require 'spec_helper'
describe Githubris::Gist do
context 'when passed a specific gist' do
subject { Githubris::Builder.new.build_gist gist_data }
let(:gist_data) { Githubris::SpecHelper.gist_data }
it 'is public' do
subject.should be_public
class Githubris::Base
# These methods will create instance methods that access
# the attributes hash and perform a transformation on them.
class << self
def accessible_attribute(*attr_names)
attr_names.each do |name|
class_eval accessible_methods_called(name)
end
end
@isaacsanders
isaacsanders / memoization.rb
Created April 26, 2012 23:18
Benchmarks on using memoization and method_decorators
class Memoize < MethodDecorator
@@memoizer = {}
def call(wrapped, *args, &block)
@@memoizer[wrapped] ||= {}
@@memoizer[wrapped][[args, block]] ||= wrapped.call(*args, &block)
@@memoizer[wrapped][[args, block]]
end
end
@isaacsanders
isaacsanders / Hide Mobile Browser Chrome
Created April 27, 2012 17:51 — forked from tonywok/Hide Mobile Browser Chrome
Normalized hide address bar for iOS & Android on page load and orientation change
/*
* Normalized hide address bar for iOS & Android
* (c) Scott Jehl, scottjehl.com
*
* Modified by
* (c) Tony Schneider
*
* MIT License
*/
(function( win ){