View email_to_self.js
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() { | |
function getSelectionText() { | |
var text = ""; | |
if (window.getSelection) { | |
text = window.getSelection().toString(); | |
} else if (document.selection && document.selection.type != "Control") { | |
text = document.selection.createRange().text; | |
} | |
return text; | |
} |
View ogaf-shapes.json
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
{ | |
"hello world": [[0, 10], [20, 30], [50, 60], [90, 10], [10, 90], [0, 10]], | |
"boogety boo": [[0, 50], [10, 30], [50, 60], [90, 10], [50, 90], [0, 10], [0, 20], [10, 30], [20, 40], [0, 50]] | |
} |
View skittles.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
import sys | |
import collections | |
import random | |
N_TRIALS = 100000 | |
FLAVORS = ['Strawberry', 'Orange', 'Lemon', 'Apple', 'Grape'] | |
def chisquared(values): | |
mean = sum(values) / float(len(values)) |
View repeat.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
import random | |
import collections | |
n = 100 | |
p_attend = 0.5 | |
p_listen = 0.5 | |
n_to_remember = 2 | |
people = list(range(n)) | |
random.shuffle(people) |
View lenient_url_scrub.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
import re | |
import scrubadub | |
class UrlFilth(scrubadub.filth.url.UrlFilth): | |
regex = re.compile(r''' | |
(?P<protocol> | |
(https?:\/\/(www\.)?|www\.)? # protocol http://, etc | |
)(?P<domain> |
View ugh.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
import os | |
import tweepy | |
auth = tweepy.OAuthHandler(os.getenv('TW_CKEY'), os.getenv('TW_CSECRET')) | |
auth.set_access_token(os.getenv('TW_ATOKEN'), os.getenv('TW_ASECRET')) | |
api = tweepy.API(auth) | |
for tweet in api.user_timeline(screen_name='cookywook', count=40): |
View prisoner_hat_riddle.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
"""Playing around with the Prisoner Hat Riddle (http://bit.ly/2hmNSav) | |
""" | |
import random | |
def make_hats(n_people): | |
"""Return a list of random black or white hats.""" | |
return [random.randint(0, 1) for _ in range(n_people)] |
View goog2md.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
"""Convert a google doc to markdown with all of the cruft removed. | |
""" | |
import hashlib | |
import imghdr | |
import shutil | |
import subprocess | |
import sys | |
import urllib | |
import urlparse |
View human_centered_design.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
"""Template for the design process.""" | |
def empathize(people): | |
raise NotImplementedError | |
def define(people, needs): | |
raise NotImplementedError |
View proselint_test.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
import sys | |
import codecs | |
from proselint.command_line import lint | |
import termcolor | |
WINDOW = 40 | |
FORE = 'white' | |
BACK = 'on_blue' |
NewerOlder