Code now located at:
https://github.com/dansimau/pystringattr
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/python | |
""" | |
Report branches or commits that are not yet merged into master. | |
""" | |
import subprocess | |
from os.path import basename | |
# Merge/environment branches. These will be excluded from the | |
# "unmerged branches" list. | |
EXCLUDE_BRANCHES = ['staging', 'uat', 'production', 'master'] |
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 csv | |
tsvin = csv.reader(sys.stdin, dialect=csv.excel_tab) | |
csvout = csv.writer(sys.stdout, dialect=csv.excel) | |
for row in tsvin: | |
# Force all fields to be string-based (Excel specific) | |
for i, val in enumerate(row): | |
row[i] = '="%s"' % val | |
csvout.writerow(row) |
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
#!/bin/bash | |
# Get last argument as the base filename | |
file=${!#} | |
if [ "$file" == "--version" ]; then | |
python --version | |
exit $? | |
fi |
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
class DirtyBase(object): | |
def __init__(self, *a, **k): | |
super(DirtyBase, self).__init__(*a, **k) | |
self.dirty = False | |
def __setitem__(self, *a, **k): | |
self.mark_dirty() | |
super(DirtyBase, self).__setitem__(*a, **k) |
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
#!/bin/bash | |
# | |
# Helper script to quickly fix merge conflicts. | |
# | |
# [email protected] | |
# 2014-02-05 | |
# | |
# |
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
<script src="https://raw.github.com/hassankhan/emojify.js/master/emojify.min.js"></script> | |
<script> | |
(function() { | |
// Config | |
emojify.setConfig({ | |
img_dir : '/emoji', | |
ignored_tags : { | |
'SCRIPT' : 1, | |
'TEXTAREA': 1, | |
'A' : 1, |
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/python | |
import sys | |
import time | |
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler | |
class RequestHandler(BaseHTTPRequestHandler): | |
def do_GET(s): | |
while True: | |
time.sleep(1000) |
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 Foundation import CFPreferencesSetValue | |
from Foundation import CFNotificationCenterPostNotification | |
from Foundation import CFNotificationCenterGetDistributedCenter | |
from Foundation import kCFPreferencesAnyApplication | |
from Foundation import kCFPreferencesCurrentUser | |
from Foundation import kCFPreferencesCurrentHost | |
# Remove offending preference | |
CFPreferencesSetValue('AppleInterfaceStyle', None, kCFPreferencesAnyApplication, | |
kCFPreferencesCurrentUser, kCFPreferencesCurrentHost) |