Moved to a https://github.com/ericmoritz/collection-protobuf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"queries": [ | |
{ | |
"href" : "http://example.org/apollo/v1/merged-fronts/", | |
"prompt" : "Get a merged front", | |
"data" : [ | |
{"name": "front", "prompt": "Front slug, may be repeated"}, | |
{"name": "page", "prompt": "The page number"}, | |
{"name": "count", "prompt": "The items per page"} | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"collection": { | |
"items": [ | |
{ | |
"href": "http://example.com/modules/1", | |
"data": [ | |
{"name": "title", "value": "Module"} | |
], | |
"links": [] | |
}, | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10.0 Nirvana - In Utero: 20th Anniversary Edition http://pitchfork.com/reviews/albums/18517-nirvana-in-utero-20th-anniversary-edition/ | |
10.0 Fleetwood Mac - Rumours http://pitchfork.com/reviews/albums/17499-rumours/ | |
10.0 Nas - Illmatic http://pitchfork.com/reviews/albums/17497-illmatic/ | |
10.0 J Dilla - Donuts (45 Box Set) http://pitchfork.com/reviews/albums/17510-donuts-45-box-set/ | |
9.5 Kanye West - Yeezus http://pitchfork.com/reviews/albums/18172-kanye-west-yeezus/ | |
9.3 Vampire Weekend - Modern Vampires of the City http://pitchfork.com/reviews/albums/17963-vampire-weekend-modern-vampires-of-the-city/ | |
9.2 Various Artists - The Rise & Fall of Paramount Records, Volume One (1917-1932) http://pitchfork.com/reviews/albums/18703-the-rise-fall-of-paramount-records-volume-one-1917-1932/ | |
9.2 Arcade Fire - Reflektor http://pitchfork.com/reviews/albums/18667-arcade-fire-reflektor/ | |
9.2 Digable Planets - Blowout Comb http://pitchfork.com/reviews/albums/18154-digable-planets-blowout-comb/ | |
9.2 Half Japanese - ½ Gentlemen / Not |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from fp.collections import get_nested | |
from fp.monads.maybe import Maybe | |
metadata = Maybe.catch(lambda: json.loads(json_src)).default({}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def modify_cache(cache, key, timeout, callback): | |
""" | |
A abstraction from the common, cache.get, if None, cache.set pattern. | |
Test an uncached value: | |
>>> cache = __mock_cache(None) | |
>>> modify_cache(cache, 'foo', 1000, lambda: 1) | |
1 | |
>>> cache.get.assert_called_with('foo') | |
>>> cache.set.assert_called_with('foo', 1, 1000) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function arraySum(i) { | |
return i.reduce(function(sum, x) { | |
if(x.reduce) { | |
return sum + arraySum(x); | |
} else if (typeof x === "number") { | |
return sum + x; | |
} else { | |
return sum; | |
} | |
}, 0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*.pyc | |
*~ | |
.env/ | |
static/ | |
data/ | |
*_pb2.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE TemplateHaskell #-} | |
module MMURL (encodeURL, decodeURL, setActions, actions) where | |
import Text.Parsec.Prim | |
import Text.Parsec.Error | |
import Text.ParserCombinators.Parsec.Char | |
import Text.ParserCombinators.Parsec.Combinator | |
import Data.HMAC | |
import Data.Char (ord) | |
import Codec.Utils (Octet) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function maybe(x) { | |
return { | |
bind: function(f) { | |
if(x == null) { | |
return null; | |
} else { | |
return f(x); | |
} | |
}, | |
getDefault: function(y) { |