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 | |
""" | |
Utilities for 256 color support in terminals. | |
Adapted from: | |
http://stackoverflow.com/questions/1403353/256-color-terminal-library-for-ruby | |
The color palette is indexed as follows: | |
0-15: System colors |
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 re | |
from hashlib import md5 | |
def gfm(text): | |
# Extract pre blocks. | |
extractions = {} | |
def pre_extraction_callback(matchobj): | |
digest = md5(matchobj.group(0)).hexdigest() | |
extractions[digest] = matchobj.group(0) | |
return "{gfm-extraction-%s}" % digest |
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
################################################################################ | |
# Command line processing | |
################################################################################ | |
# Parse the command line arguments. | |
while [ "$#" -gt "0" ]; do | |
case "$1" in | |
# TODO: Create some script options. | |
# EXAMPLE: Uncomment below to assign a 'destination directory', DST_DIR, |
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
#!/bin/bash | |
# Title: install-couchdb.sh | |
# Description: Installs the latest CouchDB version from source, | |
# not from a repository. | |
# Author: wraithmonster | |
# Reference: https://github.com/iriscouch/build-couchdb | |
# http://comments.gmane.org/gmane.comp.db.couchdb.user/16292 | |
# Uninstalling from Ubuntu's repository: | |
# http://serverfault.com/questions/348044 | |
# http://stackoverflow.com/questions/8783621 |
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
#!/bin/bash | |
# Title: install-node.sh | |
# Description: Installs node.js. | |
# Author: wraithmonster | |
# Reference: https://github.com/joyent/node/wiki/Installation | |
# Web framework - http://expressjs.com/ | |
# Node Pkg Manager - https://github.com/isaacs/npm | |
# | |
################################################################################ |
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
# References: | |
# http://bit.ly/bash-exit-status | |
# http://bit.ly/bash-remove-slash | |
# http://www.delorie.com/gnu/docs/wget/wget_27.html | |
# Strip whitespace | |
WS=`expr "$1" : '[[:space:]]*\(.*\)[[:space:]]*$'` | |
# Strip whitespace and remove any trailing slashes | |
WS_AND_SLASHES=`expr "$1" : '[[:space:]]*\(.*\)[[:space:]]*$' | sed -e 's/\\/$//g'` |
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
#!/bin/bash | |
################################################################################ | |
# | |
# Title: marmdir.sh | |
# Description: Archive the specified directory, then remove it | |
# Author: wraithmonster | |
# Reference: http://www.apl.jhu.edu/Misc/Unix-info/tar/tar_28.html | |
# http://bit.ly/bash-string-length | |
# http://www.linux.com/archive/feature/120291 |
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
ffprobe -v quiet -print_format json -show_format -show_streams "lolwut.mp4" > "lolwut.mp4.json" |
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
# -*- coding: utf-8 -*- | |
import requests | |
from PySide import QtGui, QtCore | |
import sys | |
class AddressEdit(QtGui.QLineEdit): | |
def __init__(self, parent): | |
QtGui.QLineEdit.__init__(self, parent) |
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/python | |
# -*- coding: utf-8 -*- | |
""" | |
qtdbg.py | |
A simple PyQt output widget. | |
It's main use case is to serve as an output console, for debugging or | |
other purposes. | |
It provides a file-like interface for ease of integration with other | |
python features such as the logging module, on top of a slightly |
OlderNewer