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
// ==UserScript== | |
// @name Basecamp prettification | |
// @description A user stylesheet to make Basecamp a little bit prettier. Custom colors, a bit of jiggery-pokery with the header spacing, hide the milestones calendar from the dashboard page, hide the company logo (if you have one). | |
// @include https://*.basecamphq.com/* | |
// ==/UserScript== | |
var cssNode = document.createElement('link'); | |
cssNode.type = 'text/css'; | |
cssNode.rel = 'stylesheet'; | |
cssNode.href = 'http://gist.github.com/raw/236875/4316c5130f701fa7a62dd2b5e5859b9d8bb2fc55/basecamp-custom.css'; |
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
/* With today's realign Google seem to have taken it upon themselves to reduce the line-height of each | |
* message line… yet again. So, here's a quick-n-dirty fix :) | |
* | |
* Updated March 3 2009, since Google changed all the class names :\ | |
*/ | |
/* Message line */ | |
div.nH table tbody tr { | |
line-height: 1.6; | |
} |
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
for branch in $(git branch -a | awk '{ print $NF }' | awk '/^tags\// { print $1 }'); do | |
tag=$(echo $branch | cut -f 2- -d /); | |
# create the tag | |
git checkout $branch; | |
git tag -a -m "Tagging svn tag $tag." $tag; | |
git checkout master; | |
# delete the branch | |
git branch -rD $branch; | |
done; |
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/env python3 | |
import http.server | |
import sys | |
import time | |
stdin = sys.stdin.detach() | |
class StreamingResponseRequestHandler(http.server.BaseHTTPRequestHandler): | |
def _stream_content(self, source): | |
while True: |
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
<!DOCTYPE html> | |
<html xmlns:og="http://ogp.me/ns#"> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Links demo</title> | |
<style> | |
* { margin: 0; padding: 0; } | |
</style> | |
<script type="text/javascript" src="https://github.com/DmitryBaranovskiy/raphael/raw/master/raphael-min.js"></script> |
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/env python | |
"""reindent [-d][-r][-v] [path ...] | |
-d (--dryrun) Dry run. Analyze, but don't make any changes to, files. | |
-r (--recurse) Recurse. Search for all .py files in subdirectories too. | |
-n (--nobackup) No backup. Does not make a '.bak' file before reindenting. | |
-v (--verbose) Verbose. Print informative msgs; else no output. | |
-h (--help) Help. Print this usage information and exit. |
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/env python | |
import optparse | |
import sys | |
from boto.s3.connection import S3Connection | |
def sign(bucket, path, access_key, secret_key, https, expiry): | |
c = S3Connection(access_key, secret_key) | |
return c.generate_url( | |
expires_in=long(expiry), |
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 contextlib | |
import fcntl | |
import os | |
@contextlib.contextmanager | |
def locked_file(path, mode='w'): | |
"""Context manager which will lock (and return a descriptor to) the passed file path on entry. The lock is | |
always released on exit. Will block until the lock is obtained.""" | |
assert os.path.exists(path) |
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
(* Stunnel configuration file module for Augeas *) | |
module StunnelConfig = | |
autoload xfm | |
let comment = IniFile.comment IniFile.comment_re IniFile.comment_default | |
let sep = IniFile.sep "=" "=" | |
let setting = "chroot" | |
| "compression" |
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 datetime | |
import decimal | |
import functools | |
import re | |
from dateutil import rrule | |
from django.utils import simplejson | |
from project.utils.dt import utils as dt_utils | |
from project.utils.misc import is_iterator |