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
package main | |
import "fmt" | |
func MergeChannels(a chan int, b chan int) chan int { | |
// Merges two channels of sorted ints. | |
output := make(chan int) | |
go func() { |

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 bash | |
subject="$1" | |
name="$(basename "$subject")" | |
path="$(dirname "$subject")" | |
tmp_new="$path/__tmp_new_$name" | |
tmp_meta="$path/__tmp_meta_$name.txt" | |
echo "Dumping metadata..." && | |
pdftk "$subject" dump_data > "$tmp_meta" && | |
echo "Opening metadata..." && |
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
Deferred(value?, greedy=false) | |
.state = "unresolved" | "resolved" | "rejected" | |
.done(handlerz) | |
.fail(handlerz) | |
.then(doneHandlerz failHandlerz, progressHandlerz) | |
.on (doneHandlerz, failHandlerz, progressHandlerz) | |
.resolve (value) | |
.reject (args...) |
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
This is an | |
%a(href="http://www.google.com/") example | |
\. | |
produces | |
This is an | |
<a href="http://www.google.com/">example</a> | |
. |
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
for x in range(5): | |
for y in range(10): | |
if x * y > 20: | |
print x, y | |
break # breaks both loops! | |
else: | |
continue | |
break | |
# Prints "3 7", and nothing 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
=== (Alleged) ORIGINAL CODE === | |
d = (: d_0 = 0; t = 0; v = 0 | |
: d_0 + t * v)() | |
`print` d(t=3, v=3, d_0=1) | |
`print` d(t=1, v=2) | |
`print` d(d_0=4) | |
=== TRANSLATED CODE === |
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
Does this work? | |
Gonna twitter this and see if I see anything. | |
Foo. | |
Bar. | |
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 python3.1 | |
import sys, collections, re, json | |
Post = collections.namedtuple("Post", "postid _ _ username userid title _ content _ _ _ _ _ _ _ _ _ _", rename=True) | |
raw = sys.stdin.read() | |
raw = re.sub(r"\\(!\\)", "", raw) | |
raw_posts = raw.replace("\r\n", "\r").split("\n") | |
posts = [ eval("Post({})".format(raw_post.replace("\r", "\n").replace("'", "'''"))) for raw_post in raw_posts if raw_post ] |
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
http://www.utoronto.ca/TCard/when.html | |
http://www.uc.utoronto.ca/content/view/5/1249/ |