Skip to content

Instantly share code, notes, and snippets.

@slackorama
slackorama / audit_raw_logs.py
Created September 29, 2011 22:56
Get year, month and day from a python date object.
year = time.strftime("%Y", sampledate)
month = "%02d" % int(time.strftime("%m", sampledate))
day = "%02d" % int(time.strftime("%d", sampledate))
#!/bin/bash
# fix the issue by pushing the current branch to the remote named origin
# if the branch isn't named "bugfix/bz[0-9]+ then fail
# inspired by http://reinh.com/blog/2008/08/27/hack-and-and-ship.html
current=`git branch | awk '/\*/{print $2}'`
if ! echo "$current" | egrep -q "^bugfix/bz[0-9]+" ; then
echo "Not in a bugfix branch. Must be named bugfix/bz[0-9]+"
exit 1
#!/bin/bash
# hack -- create a branch for a bz ticket off of whatever branch you are
# currently in or the branch you pass in as an argument
bug=$1
base=$2
if [ -z "${bug}" ] || [ "${bug}" == "-?" ] ; then
echo "Usage: hack [BZTICKET]"
exit 1
#!/usr/bin/env python
from xml.dom import minidom
import datetime, time
from email.utils import parsedate
import sys, codecs
# wget -O goodreads.xml
# "http://www.goodreads.com/review/list/1519786.xml?key=LV0wx2GkLwTCVLSFIiNQBQ&v=2&shelf=read&per_page=200"
import cgi
#!/usr/bin/env python
"""
Print out (to stdout) a tag cloud of bugs in bugzilla for 1.7
"""
from collections import defaultdict
import datetime
import cookielib
import urllib
import urllib2
javascript:(function()%20{if%20(window.__JQUERY_CONSOLE__)%20{window.__JQUERY_CONSOLE__.toggle();}%20else%20{function%20init($)%20{function%20HistoryManager()%20{this.curr%20=%20-1;this.entries%20=%20[];};HistoryManager.prototype%20=%20{push:%20function(item)%20{if%20(this.entries.length%20&&%20this.entries[0]%20==%20item)%20return;if%20(item.match(/^\s*$/))%20return;this.entries.unshift(item);this.curr%20=%20-1;},scroll:%20function(direction)%20{var%20moveTo%20=%20this.curr%20+%20(direction%20==%20%27prev%27%20?%201%20:%20-1);if%20(moveTo%20>=%200%20&&%20moveTo%20<%20this.entries.length)%20{this.curr%20=%20moveTo;return%20this.entries[this.curr];}%20else%20if%20(moveTo%20==%20-1)%20{this.curr%20=%20moveTo;return%20%27%27;}%20else%20{return%20null;}}};var%20context%20=%20{},history%20=%20new%20HistoryManager(),$drag%20=%20$(%27<div/>%27).css({backgroundColor:%20%27#e0e0e0%27,%20border:%20%271px%20solid%20#a0a0a0%27,%20fontSize:%20%2711px%27,%20fontFamily:%20%27sans-serif%27,%20lineHeight:%201,%20padding:%20%2
No config file found, using default configuration
pylint 0.19.0,
astng 0.19.3, common 0.45.2
Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56)
[GCC 4.4.3]
# -*- sh -*-
# Path to your oh-my-zsh configuration.
export ZSH=$HOME/.oh-my-zsh
## Read rc bits
for rcfile in "$HOME"/.shell/*.rc(rN); do
if [ -r "$rcfile" ]; then
. "$rcfile"
fi
done
// blame_comma.js -- loop through the files passed in and see who has commas
// in them
// find ../htdocs/js/ECM -type f -name "*.js" -print | xargs java -classpath /usr/share/yuicompressor-2.4.2/lib/rhino-1.6R7.jar org.mozilla.javascript.tools.shell.Main blame_comma.js
load('fulljslint.js');
load('runtime.js');
(function(args) {
% simple unit test for erlang
%
% Eshell V5.7.4 (abort with ^G)
% 1> c(fark).
% {ok,fark}
% 2> fark:test().
% Test passed.
% ok
-module(fark).
-export([wrap/1]).