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 | |
| gen_diffs.py ~/work $1 ~/patche |
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 | |
| import sqlparse | |
| import sys | |
| s = sys.stdin.read() | |
| print sqlparse.format(s, reindent=True, keyword_case='upper') |
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 | |
| dbhost=localhost | |
| dbname=stats | |
| while getopts h:d: name; do | |
| case "$name" in | |
| h) dbhost="$OPTARG";; | |
| esac | |
| done |
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 d in */; do | |
| d="${d%%/}" | |
| cat > $d/.project <<EOF | |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <projectDescription> | |
| <name>$d</name> | |
| <comment></comment> | |
| <projects> | |
| </projects> | |
| <buildSpec> |
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 | |
| import midi | |
| import midi.sequencer as sequencer | |
| def play(seq, notes): | |
| for event in notes: | |
| buf = seq.event_write(event, tick=True) | |
| if buf is not None and buf < 1000: | |
| time.sleep(.5) |
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 | |
| python -c "import sys, json; print json.dumps(json.load(sys.stdin), indent=4)" < "$1" | sponge "$1" |
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 | |
| import pickle, sys | |
| x = sys.stdin.read().strip() | |
| print pickle.loads(x) |
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
| from pyparsing import * | |
| import music21 as m21 | |
| import string | |
| name = Word(string.printable.replace(':', '')) | |
| control_name = oneOf('o d b') | |
| control_value = Word(nums).setParseAction(lambda x: int(x[0])) | |
| control_pair = Group(control_name + Suppress('=') + control_value + Suppress(Optional(','))) | |
| control_section = OneOrMore(control_pair) |
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 redis | |
| import flask | |
| app = flask.Flask(__name__) | |
| @app.route('/stream') | |
| def stream(): | |
| red = redis.Redis() | |
| pubsub = red.pubsub() | |
| pubsub.subscribe('chat') |
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 alsaseq | |
| import alsamidi | |
| alsaseq.client( 'marek', 0, 1, True ) | |
| alsaseq.connectto( 0, 129, 0 ) | |
| alsaseq.start() | |
| alsaseq.output(alsamidi.noteonevent(0, 60, 64)) |