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
#!/usr/bin/env python | |
""" | |
urlnorm.py - URL normalisation routines | |
urlnorm normalises a URL by; | |
* lowercasing the scheme and hostname | |
* taking out default port if present (e.g., http://www.foo.com:80/) | |
* collapsing the path (./, ../, etc) | |
* removing the last character in the hostname if it is '.' |
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
# -*- coding: utf-8 -*- | |
from functools import wraps | |
import redis | |
from flask import Flask, request | |
from datetime import datetime | |
app = Flask(__name__) | |
# -*- coding: utf-8 -*- |
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
https://chart.googleapis.com/chart?cht=bvs&chs=750x50&chd=t:0,0,0,0,0,10,50,60,80,40&chco=EBF2FF&chbh=25,1&chm=r,FFFFFF,0,-0.01,0.01,1|R,FFFFFF,0,-0.01,0.01,1 |
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 os | |
from random import choice | |
if len(sys.argv) < 2: | |
print 'Usage: python {} /absolute/path/to/article/directory'.format(os.path.basename(__file__)) | |
exit() | |
content = """title: Pokedex for {} | |
summary: true |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Ansi 0 Color</key> | |
<dict> | |
<key>Blue Component</key> | |
<real>0.16470588743686676</real> | |
<key>Green Component</key> | |
<real>0.20784313976764679</real> |
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
from pymongo import MongoClient | |
import datetime | |
import bunch | |
from faker import Faker | |
from random import choice | |
client = MongoClient(host="localhost", port=27017) | |
faker = Faker() | |
posters = [] |
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
/** | |
* Number Filter | |
* @Param input The number to format | |
* @Param fractionSize Nubmer of decimal places to round to; defaults to 2 | |
* @Param groupSep Number group separator; defaults to a single space ' ' | |
* @Param decimalSep Decimal place separator; defaults to single period | |
* @return string, ex: 1 234 345 | |
*/ | |
var DECIMAL_SEP = '.' // change to override default | |
var GROUP_SEP = ' ' // change to override default |
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
Gost - A simple command line utility for easily creating Gists for Github | |
Usage: | |
gost (--file=<file> | --clip) [--name=<name>] [--description=<description>] [--token=<token>] [--public] | |
gost (--help | --version) | |
Options: | |
-t --token=<token> Optional Github API authentication token. If excluded, your Gist will be created anonymously. | |
-f --file=<file> Create a Gist from file. | |
-n --name=<name> Optional name for your new Gist. |
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
Gost - A simple command line utility for easily creating Gists for Github | |
Usage: | |
gost (--file=<file> | --clip) [--name=<name>] [--description=<description>] [--token=<token>] [--public] | |
gost (--help | --version) | |
Options: | |
-t --token=<token> Optional Github API authentication token. If excluded, your Gist will be created anonymously. | |
-f --file=<file> Create a Gist from file. | |
-n --name=<name> Optional name for your new Gist. |
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
Gost - A simple command line utility for easily creating Gists for Github | |
Usage: | |
gost (--file=<file> | --clip) [--name=<name>] [--description=<description>] [--token=<token>] [--public] | |
gost (--help | --version) | |
Options: | |
-t --token=<token> Optional Github API authentication token. If excluded, your Gist will be created anonymously. | |
-f --file=<file> Create a Gist from file. | |
-n --name=<name> Optional name for your new Gist. |