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 print_function | |
import abc | |
import functools | |
class BaseContextDecorator(object): | |
__metaclass__ = abc.ABCMeta | |
def __call__(self, func): |
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
# There was a day where I have too many color schemes in iTerm2 and I want to remove them all. | |
# iTerm2 doesn't have "bulk remove" and it was literally painful to delete them one-by-one. | |
# iTerm2 save it's preference in ~/Library/Preferences/com.googlecode.iterm2.plist in a binary format | |
# What you need to do is basically copy that somewhere, convert to xml and remove color schemes in the xml files. | |
$ cd /tmp/ | |
$ cp ~/Library/Preferences/com.googlecode.iterm2.plist . | |
$ plutil -convert xml1 com.googlecode.iterm2.plist | |
$ vi com.googlecode.iterm2.plist |
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
sudo apt-get update | |
sudo apt-get dist-upgrade -y | |
sudo apt-get install -y openssh-server | |
sudo apt-get install -y git | |
sudo apt-get install -y build-essential | |
sudo apt-get install -y python-dev python3-dev | |
sudo apt-get install -u libtool libtool-bin autoconf automake cmake g++ pkg-config unzip gperf | |
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
In [1]: from itertools import zip_longest | |
In [2]: size = 500 | |
In [3]: parts = 16 | |
In [4]: ranges = list(range(0, size, size // parts)) | |
In [5]: ranges | |
Out[5]: |
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
"""Testing chromote library. | |
https://github.com/iiSeymour/chromote | |
""" | |
from __future__ import print_function | |
import itertools | |
import time | |
from chromote import Chromote |
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
# spam.py | |
try: | |
import foo | |
except ImportError: | |
import simplefoo as foo |
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
# This tmux statusbar config was created based on gruvbox colorscheme | |
set -g status "on" | |
set -g status-justify "left" | |
set -g status-left-length "100" | |
set -g status-right-length "100" | |
set -g status-right-attr "none" | |
set -g status-attr "none" | |
set -g status-utf8 "on" | |
set -g status-left-attr "none" |
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
# Color scheme for base16-builder based on gruvbox color scheme | |
# (https://github.com/morhetz/gruvbox). | |
# [1] gruvbox.yml | |
scheme: "Gruvbox" | |
author: "Gordon Chiam (https://github.com/gchiam)" | |
base00: "282828" | |
base01: "504945" | |
base02: "7c6f54" | |
base03: "ebdbb2" | |
base04: "bdae93" |
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 functools | |
import logging | |
class SimpleWorkflowEngine(object): | |
"""A simple workflow engine | |
Usage: | |
from functools import partial | |
def initialize(number): |
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
"""Dashing module""" | |
import logging | |
import urllib2 | |
import simplejson as json | |
DEFAULT_DASHING_AUTH_TOKEN = 'YOUR_AUTH_TOKEN' |