Skip to content

Instantly share code, notes, and snippets.

Mark Simoneau marksim

Block or report user

Report or block marksim

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am marksim on github.
  • I am marksim (https://keybase.io/marksim) on keybase.
  • I have a public key whose fingerprint is 351B AEFF 19E6 F01A 283F E0E6 FB4A 9F3A 2F2C B718

To claim this, I am signing this object:

View employment_spec.rb
require 'rspec'
require 'date'
class EmploymentEvent < Struct.new(:date, :status)
def <=> (b)
date <=> b.date
end
def as_start
date + 1
View github.md

Github Questions

Q1:

Knowing what you know about GitHub, how would you design the high level infrastructure for github.com? What sequence of steps would happen when loading http://www.github.com in a browser? Don't worry about describing the specific libraries and services that handle each step.

A1:

Assumptions

Well, let's start with a few assumptions so we're on the same page:

View server_name_spec.rb
require 'rspec'
def next_server_number(server_numbers)
server_numbers.sort.each.with_index do |s, i|
return i+1 if s > i+1
end
return server_numbers.count + 1
end
describe 'next_server_number' do
View release_notes
#!/usr/bin/ruby
version = ARGV.first
if version
releases = `heroku releases -n 50 --remote=production | grep Deploy | grep -A1 #{ARGV.first}`
commits = releases.split("\n").reverse.map {|r| r.split(/\s/)[3] }.join('..')
command = 'git log --pretty=format:"%h - %an, %ar : %s" ' + commits
puts `#{command}`
else
puts "A version is required: ex: release_notes v191"
View new_computer_setup
xcode-select --install
# homebrew / cask / util
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
brew doctor
brew tap phinze/homebrew-cask
brew install brew-cask
brew cask install alfred
brew cask install iterm2
@marksim
marksim / .powenv
Last active Jan 4, 2016
Pow Config
View .powenv
# Automatically exports all variables in .env files
export $(cat .env)
View game_of_life.rb
require 'rspec'
class GameOfLife
def initialize(generation)
@generation = generation
end
attr_reader :generation
def is_alive?(x, y)
View tictactoe_spec.rb
require 'rspec'
class TicTacToe
attr_reader :current_player
def initialize
@current_player = 'O'
@plays = {'O' => [], 'X' => []}
end
def play(x,y)
View tic_tac_toe_spec.rb
require 'rspec'
require 'set'
class TicTacToe
attr_reader :current_player
def initialize
@current_player = 'O'
@plays = {
'O' => [],
You can’t perform that action at this time.