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 | |
# -*- coding: utf-8 -*- | |
""" """ | |
import json | |
from urllib2 import urlopen | |
from lxml.html import document_fromstring | |
from lxml.cssselect import CSSSelector as cs |
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 | |
cur=`pwd` | |
inotifywait -mqr --timefmt '%d/%m/%y %H:%M' --format '%T %w %f' \ | |
-e modify ./ | while read date time dir file; do | |
ext="${file##*.}" | |
if [[ "$ext" = "go" ]]; then | |
echo "$file changed @ $time $date, rebuilding..." | |
go build |
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 | |
PORT="8000" | |
usage() { | |
cat << EOF | |
usage: $0 host [port] | |
EOF | |
} |
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 | |
LOADING=false | |
usage() | |
{ | |
cat << EOF | |
usage: $0 [options] dbname | |
OPTIONS: |
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 | |
from lxml.html.clean import Cleaner | |
from lxml.html import defs | |
class AttrWhitelistCleaner(Cleaner): | |
"""An HTML Cleaner that can use an attribute whitelist. Defaults to using | |
the attributes that are whitelisted by default with ``safe_attrs_only`` | |
turned on.""" | |
def __init__(self, **kw): |
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 | |
# capture an area on OSX and run quickup on the produced file | |
CAPPATH="$HOME/tmp-capture.png" | |
if [ -n `which screencapture` ]; then | |
screencapture -i $CAPPATH | |
# esc exits screencapture without writing, don't try to upload in this case |
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 | |
# -*- coding: utf-8 -*- | |
"""Which json is the best json.""" | |
import json | |
import simplejson as sjson | |
import ujson | |
import cjson | |
import bson |
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 | |
# -*- coding: utf-8 -*- | |
"""Simple eventlet POC to check how to get ZMQ sockets working with | |
subprocesses spawned by a simple process.""" | |
import os | |
import eventlet | |
import multiprocessing |
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 | |
# -*- coding: utf-8 -*- | |
"""Simple gevent POC to check how to get ZMQ sockets working with | |
subprocesses spawned by a simple process.""" | |
# this code doesn't seem to work properly; it has a | |
# tendency to hang at various parts of the req/rep process | |
# all of this stuff works flawlessly if you change: |
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 | |
# -*- coding: utf-8 -*- | |
"""A native python implementation of the par2 file format. | |
This is only intended to be able to read packets in par2, not execute | |
repair, verify, or create new par2 files.""" | |
import struct |