Take I-30 eastbound to Exit 52 or 59. Go left for about forty miles. Now make a left and you should see a man sellling newspapers on the south corner. Don't be alarmed if he's not there, though; sometimes a different guy fills in for him. Continue on Comstock for 3.2 miles, and when it hits Towerview (Road or Place--I forget which, but no matter, because those two streets are /not/ parallel), make a full ninety-degree turn at my friend Patty Ann's place. (Be careful, because the sign really jumps out at you.) Continue for about eighty or ninety minutes until you see a gravel road (if you see a stop sign that is slightly lighter than the usual hue you've gone about seventy miles too far). Turn left onto the access road (it'll look like you're heading off a cliff), then drive a considerable distance forward and take I-80 West (Scranton) to Exit 65B/I-195 South (Vancouver). You idiot! Make a narrow ri
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
function charCount(str) { | |
if (!str || typeof str !== 'string') { | |
throw 'must provide a string'; | |
} | |
var letter, | |
countObj = {}, | |
alphabeticalLetters = [], | |
outputString = '', | |
letterCount; |
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 operator | |
def geometric_mean(iterable): | |
return (reduce(operator.mul, iterable)) ** (1.0/len(iterable)) |
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/python | |
# a script to get all the common tropes for media from tv tropes | |
# usage: | |
# python tv_tropes_matcher.py name1 name2 [name3...nameN] | |
# please put names with spaces or special characters in quotes | |
# you can also pass in the urls if it won't automatch by name. | |
# pip install pattern | |
# pip install pyquery |
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 easygui # easy_install easygui | |
some_input = easygui.enterbox( | |
msg="Enter some text below!", | |
title="Title of window", | |
strip=True, # will remove whitespace around whatever the user types in | |
default="This will show up in the box by default") |
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
var percentChance = function(integerPercent) { | |
return Math.random()*100 < integerPercent; | |
}; |
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 time | |
from watchdog.observers import Observer | |
from watchdog.events import FileSystemEventHandler | |
import envoy | |
import os | |
import datetime | |
class NotebookConverterHandler(FileSystemEventHandler): | |
def on_modified(self, event): | |
if event.src_path.endswith('.ipynb'): |
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
def say_hello_glen(): | |
return 'hello, glen' | |
def say_hello(name): | |
return 'hello, ' + name | |
def greet(name, language): | |
if language is 'spanish': | |
return 'hola, ' + name | |
if language is 'english': |
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
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/"> | |
<ShortName>Google I'm Feeling Lucky</ShortName> | |
<Description>Google I'm Feeling Lucky Instant</Description> | |
<InputEncoding>UTF-8</InputEncoding> | |
<Image width="16" height="16">data:image/x-icon;base64,R0lGODlhEAAQAPfLAAATVikwdA8SnxUfgAsWpAAilholjxw4jBc7kwAlvQQ2sRMsoBUqqhMzuhY/vxw4tSgmiyM1mSUztiQ6sTE3sQ4qyxMxxRoyxiAuxR1CtBxJsBxasSJuuTFguBte0Rlf2xVc9h9W9xVjzxVr0gdj6BRh4R1o5yBcyiZbyydT1i9b2Ddb1iFY6CJg2Vpor1dzvEJu20Z0yi23QDy1REi2OUy0O1WzOVC4PU+tVUe5Sk2xQU2zRUO4UE21Ula2SmKEqWWF2HyPx2+a6X6e6Xqk1m+s78sUDs4UGdEQB9YfDdwaANEfHd0YEscjAM4mAM0qANIoD9IkGdslGswuItYgL4aP0ImP2YGZ36Opzaq2wq/S+rzX/7/e8MrS1MLO/sTb48rT8snX/83c89PZ+crq+cH1/9Dl/9Ln/93r/9fy/+Hf7P/42eDm/O7u/+T29uX2/eT2/+f4/+f5/+j/9u//8+3/9u7/9ur5/+j//+n//+v//u3//+7//e7//+////b66/T/6vX/6/f/7f/07fj/4fv/4Pj/5v/45v7/4/r+7/3/6fDw+Pfx//D/9/X/8fT/8/f/8ff/8/D///H///L8/fL///P///X7//b6/ff/+/T///b9//f///v19//w9v/09P/29v/x+f/y///z///1+v/1///2///3//j79P/58/z/8/z99/z/9v7/9P7/9vn7//v6//j9//n9//j///n// |
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
""" | |
We want to run a function asychronously and run a | |
callback function with multiple parameters when it | |
returns! | |
In this example, we are pretending we're analyzing | |
the names and ages of some people. We want to print | |
out: | |
jack 0 |