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 | |
| """ | |
| Use Tor through Python. Note, Tor must be running for the script to | |
| work properly. | |
| """ | |
| import urllib2 | |
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
| $(document).ready(function() { | |
| var location = window.location.href; | |
| if (location.exec(window.location.href)) { | |
| initialize(); | |
| } else { | |
| $('.goMap').click(function(e) { | |
| initialize(); | |
| }); | |
| } | |
| }); |
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
| $(document).ready(function() { | |
| var location = /#wifi/i; | |
| if (location.exec(window.location.href)) { | |
| initialize(); | |
| } else { | |
| $('.goMap').click(function(e) { | |
| initialize(); | |
| }); | |
| } | |
| }); |
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
| #!/bin/bash | |
| # For working with Python's pip and virtualenv modules. | |
| activate() { | |
| if [ "$1" != "" ]; then | |
| source "$1/bin/activate" | |
| elif [ -d "env" ]; then | |
| source "env/bin/activate" | |
| 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
| my_list = [{'a': 1}, {'a': 2}, {'a': 3}] | |
| print sum(d['a'] for d in my_list) |
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 GaryBernhardt(object): | |
| def __getitem__(self, value): | |
| return "ohai" | |
| gb = GaryBernhardt() | |
| print gb['foo'] |
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
| """ | |
| Taken from: https://gist.github.com/1094140 | |
| """ | |
| from functools import wraps | |
| from flask import request, current_app | |
| def jsonp(func): | |
| """Wraps JSONified output for JSONP requests.""" |
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 working with the Popcorn/Vimeo interaction. | |
| # Here's the JS Fiddle: http://jsfiddle.net/zachwill/eKHKc/ | |
| Popcorn.vimeo('#vimeo', 'http://vimeo.com/123456') | |
| .footnote( | |
| start: 1, end: 5 | |
| text: "Hey, it's working!" | |
| target: "foo" | |
| ) |
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
| String::zfill ||= (padding) -> | |
| string = this | |
| while string.length < padding | |
| string = '0' + string | |
| string |
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
| """ | |
| Test if a request is XHR. | |
| """ | |
| import argparse | |
| from flask import Flask, request, jsonify, make_response | |
| app = Flask(__name__) | |