This file contains hidden or 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
<script src="http://fb.me/react-0.11.2.js"></script> | |
<script src="http://fb.me/JSXTransformer-0.11.2.js"></script> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.7.0/underscore-min.js"></script> | |
<div id="content"></div> | |
<script type="text/jsx;harmony=true"> | |
/** @jsx React.DOM */ | |
var Root = React.createClass({ |
This file contains hidden or 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
<script src="http://fb.me/react-0.11.2.js"></script> | |
<script src="http://fb.me/JSXTransformer-0.11.2.js"></script> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.7.0/underscore-min.js"></script> | |
<div id="content"></div> | |
<script type="text/jsx;harmony=true"> | |
/** @jsx React.DOM */ | |
var Root = React.createClass({ |
This file contains hidden or 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
nav.navigation { | |
font-size: 12px; | |
position: absolute; | |
top: 0; left: 0; right: 0; | |
background: #fefefe; | |
border-bottom: 1px solid rgba(0, 0, 0, 0.2); | |
} | |
nav.navigation ul { | |
margin: 0; | |
padding: 0; |
This file contains hidden or 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
#!/usr/bin/env python | |
''' | |
DEPENDENCIES: | |
$ brew install ffmpeg | |
$ brew install imagemagick | |
$ python ./mov2gif.py input.mov output.gif 15 | |
''' |
This file contains hidden or 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
class IgnoreSubtree(Exception): | |
pass | |
def preorder_traversal(obj): | |
try: | |
yield obj | |
except IgnoreSubtree: | |
return | |
if isinstance(obj, dict): |
This file contains hidden or 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
#!/usr/bin/env python | |
import sys | |
class IgnoreSubtree(Exception): | |
pass | |
def preorder_traversal(obj): | |
try: | |
yield obj | |
except IgnoreSubtree: |
This file contains hidden or 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
#!/usr/bin/env python | |
class IgnoreSubtree(Exception): | |
pass | |
def preorder_traversal(obj): | |
try: | |
yield obj | |
except IgnoreSubtree: | |
return | |
else: |
This file contains hidden or 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
import struct | |
class Square(object): | |
def __init__(self, char): | |
self.char = char | |
self.down = None | |
self.across = None | |
def __repr__(self): | |
return self.char |
This file contains hidden or 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
#!/usr/bin/env python | |
'''Print out start:stop locations for each reference in a BAI file.''' | |
import json | |
import struct | |
import sys | |
# -- helper functions -- | |
def unpack(stream, fmt): | |
size = struct.calcsize(fmt) |
This file contains hidden or 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
import sys | |
si = sys.stdin | |
CHUNK_SIZE = 100000 | |
n = 0 | |
while True: | |
b = si.read(CHUNK_SIZE) | |
if not b: |