Skip to content

Instantly share code, notes, and snippets.

Internet Scale Services Checklist

A checklist for designing and developing internet scale services, inspired by James Hamilton's 2007 paper "On Desgining and Deploying Internet-Scale Services."

Basic tenets

  • Does the design expect failures to happen regularly and handle them gracefully?
  • Have we kept things as simple as possible?
@wejn
wejn / web-servers.md
Last active August 29, 2015 14:11 — forked from willurd/web-servers.md

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@wejn
wejn / Ex0105.rb
Created November 24, 2014 23:04
Cracking the Code Interview, Exercise 1.5
#!/usr/bin/env ruby
module Ex0105
def self.compress(str)
out = str.scan(/./).reduce([[], 't', 0]) do |(buf, cur, num), c|
if cur == c
[buf, cur, num + 1]
else
if num > 0
buf << cur
@wejn
wejn / introrx.md
Last active August 29, 2015 14:08 — forked from staltz/introrx.md

The introduction to Reactive Programming you've been missing

(by @andrestaltz)

So you're curious in learning this new thing called (Functional) Reactive Programming (FRP).

Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:

Rx.Observable.prototype.flatMapLatest(selector, [thisArg])

Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.

### Keybase proof
I hereby claim:
* I am wejn on github.
* I am wejn (https://keybase.io/wejn) on keybase.
* I have a public key whose fingerprint is CC15 927C 8B00 1927 15EA E5C0 8911 469B 691A 16D4
To claim this, I am signing this object:
@wejn
wejn / gist:4966076
Last active December 13, 2015 19:58
add shebang, fix loop, fix conversion, fix formatting
#!/usr/bin/env ruby
# encoding: utf-8
bill = nil
loop do
print "\rHow much you bill was (CZK): "
bill = gets
begin
bill = Integer(bill)
break
rescue Object
@wejn
wejn / gist:1709758
Created January 31, 2012 10:14
Ruby Koans - About Hashes - why breaking out the hash is necessary?
def test_changing_hashes
hash = { :one => "uno", :two => "dos" }
hash[:one] = "eins"
expected = { :one => "eins", :two => "dos" }
assert_equal true, expected == hash
assert_equal true, { :one => "eins", :two => "dos" } == hash
# Bonus Question: Why was "expected" broken out into a variable
# rather than used as a literal?