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
# Run me with: | |
# python3 setup.py bdist_wheel --cythonize | |
# ... | |
if '--cythonize' in argv: | |
from Cython.Build import cythonize | |
packaging = { | |
'ext_modules': cythonize('lib/**/*.py'), | |
} |
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
# Prompt | |
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ [\1]/' | |
} | |
export PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$\[\033[38;5;166m\]$(parse_git_branch)\[\033[00m\] ' | |
# Less Colors for Man Pages | |
export LESS_TERMCAP_mb=$'\E[01;31m' # begin blinking | |
export LESS_TERMCAP_md=$'\E[01;38;5;74m' # begin bold | |
export LESS_TERMCAP_me=$'\E[0m' # end mode |
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
# Requires thrid-party awesome module colorlog | |
import logging | |
from colorlog import ColoredFormatter | |
from . import __version__ | |
log = logging.getLogger(__name__) |
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 random import choice | |
from datetime import datetime | |
from string import ascii_letters, digits | |
def generate_string(length, choices=ascii_letters + digits): | |
return ''.join(choice(choices) for _ in range(length)) | |
def compare_lookup(length): |
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 python3 | |
""" | |
pybin2h is a tool for converting binary data to a C-style uchar array for | |
compiling straight into C/C++ code written in Python 3. | |
""" | |
from itertools import islice | |
__version__ = '0.1.0' |
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 __future__ import division | |
from os.path import isfile | |
from json import dumps | |
from logging import getLogger | |
from traceback import format_exc | |
from base64 import b64encode, b64decode | |
from multiprocessing import Value, Queue, Event, Process | |
log = getLogger(__name__) |
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 python3 | |
# -*- coding: utf-8 -*- | |
from logging import getLogger as get_logger # noqa | |
from datetime import datetime | |
from github import Github | |
log = get_logger(__name__) |
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 bash | |
set -o errexit | |
set -o nounset | |
# set -o xtrace | |
DOMAIN=${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
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
from os import getcwd | |
from json import loads | |
from sys import argv, stdout | |
from shlex import split as shsplit | |
from os.path import expanduser, isfile, relpath, join | |
from subprocess import check_output, CalledProcessError, Popen, PIPE |
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 python3 | |
# -*- coding: utf-8 -*- | |
# Copyright (C) 2015-2017 Carlos Jenkins <[email protected]> | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# |