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
""" | |
Covert html tables into csvs. | |
""" | |
import sys | |
import urllib | |
from lxml import etree | |
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 markdown files containing Python code into working Python files. | |
Usage: python md2.py [markdownfile] | |
Example: | |
Flask is Fun | |
============ | |
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 qualified Data.Map as M | |
data Direction = N | S | E | W deriving Eq | |
type Location = (Int, Int) | |
data Sticker = Red | Blue deriving Eq | |
data Widget = Widget Location [Sticker] |
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 inspect | |
import re | |
import pprint | |
FUNCTION_PATTERN = re.compile(".*\s((\.|\w)+)\(") | |
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 timeit | |
setup = """ | |
def primes(n): | |
'''Get all primes up to n.''' | |
if n < 2: | |
return [] | |
nums = range(n) | |
sieve = set(xrange(2, n)) |
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 -*- | |
""" | |
:copyright: (c) 2011 by Armin Ronacher. | |
:copyright: (c) 2011 by the Werkzeug Team, see AUTHORS for more details. | |
:license: BSD, see LICENSE for more details. | |
""" | |
import os | |
import sys | |
import unittest |
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
# Start postgres | |
alias pgstart='pg_ctl -l $PGDATA/server.log start' | |
# Stop postgres | |
alias pgstop='pg_ctl stop -m fast' | |
# Postgres stuff | |
export PGDATA='/usr/local/var/postgres' | |
# Register a python project on pypi |
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
git@github.com:Ceasar/dot_zsh.git | |
git@github.com:Ceasar/dot_vim.git | |
git@github.com:Ceasar/dot_gitconfig.git | |
git@github.com:Ceasar/dotfiles.git |
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
class Email(object): | |
message = 'Enter a valid email address.' | |
user_regex = re.compile( | |
r"(^[-!#$%&'*+/=?^_`{}|~0-9A-Z]+(\.[-!#$%&'*+/=?^_`{}|~0-9A-Z]+)*$" # dot-atom | |
r'|^"([\001-\010\013\014\016-\037!#-\[\]-\177]|\\[\001-\011\013\014\016-\177])*"$)', # quoted-string | |
re.IGNORECASE) | |
domain_regex = re.compile( | |
r'(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.)+(?:[A-Z]{2,6}\.?|[A-Z0-9-]{2,}\.?$)' # domain | |
# literal form, ipv4 address (SMTP 4.1.3) | |
r'|^\[(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}\]$', |
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
## | |
# sms_bomb | |
# ======== | |
# | |
# Send a bunch of texts (from multiple numbers) to a target number. | |
# | |
# Installation | |
# ------------ | |
# | |
# `gem install twilio-ruby` |