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 | |
if echo ${1} | grep -q '^vmnet[0-9]$'; then | |
ERRCOUNT='0' | |
PIDSNIFF='0' | |
PIDTDUMP='0' | |
CAPINTF="${1}" | |
CAPFILE="$(mktemp -t capture)" |
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
# | |
# _______ | |
# ____________ _______ _\__ /_________ ___ _____ | |
# | _ _ \ _ | ____\ _ / | |/ _ \ | |
# | / / / / | | | /___/ _ | | / / | |
# |___/___/ /___/____|________|___ | |_| |___|_____/ | |
# \__/ |___| | |
# | |
# | |
# Put this in your ~/.zshrc or ~/.bashrc: |
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 | |
# _______ | |
# ____________ _______ _\__ /_________ ___ _____ | |
# | _ _ \ _ | ____\ _ / | |/ _ \ | |
# | / / / / | | | /___/ _ | | / / | |
# |___/___/ /___/____|________|___ | |_| |___|_____/ | |
# \__/ |___| | |
# | |
# (c) 2011 Wijnand Modderman-Lenstra <[email protected]> | |
# MIT License |
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 python | |
''' | |
======================= | |
ANSI Screen Rendition | |
======================= | |
Library to help you use ANSI graphics on text terminals, featuring | |
cursor movement and color support. |
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 python | |
# | |
# _______ | |
# ____________ _______ _\__ /_________ ___ _____ | |
# | _ _ \ _ | ____\ _ / | |/ _ \ | |
# | / / / / | | | /___/ _ | | / / | |
# |___/___/ /___/____|________|___ | |_| |___|_____/ | |
# \__/ |___| | |
# | |
# |
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 json | |
import datetime | |
try: | |
import iso8601 | |
except ImportError: | |
iso8601 = None | |
class FancyJSONEncoder(json.JSONEncoder): | |
_registry = {} |
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 | |
# | |
# compile logo: | |
# | |
# user@bitlair ~$ python bitlair.py > bitlair.svg | |
# user@bitlair ~$ convert bitlair.svg bitlair.png | |
# user@bitlair ~$ aplay tada.wav | |
# | |
LOGO = ''' |
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
class Ternary(object): | |
''' | |
Ternary-ish emulation, it looks like C-style ternary operator:: | |
x = a ? b : c | |
In Python we would write:: | |
>>> x = a and b or c |
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
def singleton(cls): | |
instances = {} | |
def instance(): | |
if cls not in instances: | |
instances[cls] = cls() | |
return instances[cls] | |
return instance |
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 requires https://gist.github.com/771026 | |
*/ | |
var Ticker = new Class({ | |
Implements: [Options], | |
options: { | |
delay: 5000 |