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 __future__ import print_function | |
import os | |
import sys | |
import json | |
from zlib import compress | |
from httplib import HTTPSConnection | |
from urllib import urlencode | |
COMPILER_JAR_PATH = os.path.expanduser("~/closure-compiler/compiler.jar") |
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 datetime as dt | |
import sublime_plugin | |
DEV_NAME = "mb" | |
class TODOCommand(sublime_plugin.EventListener): | |
def _todo_str(self): |
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 sys | |
import itertools as it | |
PY2 = sys.version_info.major == 2 | |
if PY2: | |
range = xrange | |
def unchain(elems, chain_size): |
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
# -*- coding: utf-8 -*- | |
# "Writing Python 3 code that's compatible with Python 2 is | |
# much more rewarding than the opposite. Not only does that | |
# make your code more future-proof, but Python 3’s advantages | |
# (like the saner string handling) start shining quickly. | |
# Dealing with Python 2 becomes a backwards compatibility | |
# requirement" – "Porting to Python 3" from the Django Project | |
# This file provides boilerplate for scripts to run in both | |
# python2.7 and python3.4. As much as possible it attempts |
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
[user] | |
name = Manuel Barkhau | |
email = [email protected] | |
[push] | |
default = simple | |
[alias] | |
co = checkout | |
amend = commit --amend | |
sts = status --short | |
stt = status --untracked-files=no |
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 re | |
import json | |
ONELINE_COMMENT_RE = re.compile(r""" | |
^ # comment must be at the start of the line | |
\s* # arbitrary whitespace | |
// # start of the comment | |
(.*) # the comment | |
$ # until the end of line | |
""", re.MULTILINE | re.VERBOSE) |
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
cd rust-nightly-x86_64-unknown-linux-gnu | |
cd $HOME/rust-nightly-x86_64-unknown-linux-gnu | |
bash install.sh | |
cd $HOME | |
chown -R $USER:$USER rust-nightly-x86_64-unknown-linux-gnu | |
git clone https://github.com/murarth/rusti.git | |
chown -R $USER:$USER rusti | |
cd $HOME/rusti | |
cargo 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
import sys | |
def getarg(argname, args=sys.argv[1:]): | |
long_arg = '--' + argname | |
short_arg = '-' + argname[:1] | |
for idx, arg in enumerate(args): | |
if arg.startswith(long_arg): | |
if arg == long_arg: | |
# check for parameter |
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
# coding: utf-8 | |
""" | |
Pretty print replacement for timeit | |
pp_timeit.auto_timeit runs a statement and automatically | |
determines the number of repetitions required to gain | |
satisfactory accuracy (similar to timeit.main). | |
pp_timeit uses auto_timeit and prints the result so that the | |
different magnitudes of results are visible by their alignment. |
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 operator import itemgetter | |
def multisort(vals, sort_spec, in_place=False): | |
comparers = [] | |
for i, spec in enumerate(sort_spec): | |
if isinstance(spec, tuple): | |
key, polarity = spec | |
elif isinstance(spec, (str, unicode)): | |
key = spec.replace("-", "", 1) | |
polarity = 1 |