Skip to content

Instantly share code, notes, and snippets.

@jgrgt
jgrgt / main.c
Created October 1, 2010 14:53 — forked from squaredisk/main.c
///////////////////////////////////////////////////////////////////////////////
//
// Simple game where the mission is the correctly estimate the passage of a
// small amount of time
//
// Gareth Williams // SquareDisk // All round, different
//
#include "msp430g2211.h"
# This script connects to an account in your Pidgin and sends an IM message
# to one of your contacts. You can pass the message as the first command
# line argument to the script. The default message is "Poke!". Change the
# NAME, PROTOCOL and TO variables at the beginning of the script to your
# liking. Make sure the account is enabled in your Pidgin or the script
# will fail.
import dbus
import sys
#!/bin/sh
TRUNK_HASH=`git show-ref --hash remotes/trunk`
REV=`git svn find-rev "$TRUNK_HASH"`
if [ "$#" -eq 0 ]
then
HASHES="$TRUNK_HASH..HEAD"
else
HASHES="$1"
@jgrgt
jgrgt / Carvelang-10
Created November 23, 2010 14:37
10 line Carvelang file.
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ[]{}()# abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ[]{}()# abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ[]{}()# abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ[]{}()# abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ[]{}()# abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ[]{}()# abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ[]{}()# abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ[]{}()# abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ[]{}()# abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ[]{}()# abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ[]{}()# abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ[]{}()# abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ[]{}()# abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ[]{}()# abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ[]{}()# abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ[]{}()# abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ[]{}()# abcd
[defaults]
# suppress noisy extdiff header message
#cdiff = -q
#import = --no-commit
#backup = --merge
[hooks]
pretxncommit.crlf = python:hgext.win32text.forbidcrlf
# Prevent "hg pull" if MQ patches are applied.
prechangegroup.mq-no-pull = ! hg qtop > /dev/null 2>&1
def i_am_wrong(d=dict()):
key = "results"
if key not in d:
d[key] = list()
d[key].append("Hi!")
return d
print "No problems:"
print i_am_wrong(dict())
print i_am_wrong(dict())
@jgrgt
jgrgt / fetch_pyvideo.py
Created March 17, 2012 14:11 — forked from codeinthehole/fetch_pyvideo.py
Fetch PyCon videos from pyvideo.org and convert them to M4V so they can be synced to your iPhone
# Hacky script for downloading videos from PyVideo and converting them to m4v
# format so they can be synced onto your apple device. Useful if you
# want to see everything that happened at PyCon while commuting.
#
# Requirements:
# * pip install requests BeautifulSoup
# * youtube-dl (from https://github.com/rg3/youtube-dl/) - add this to the
# directory where this script runs and ensure its execute bit is set.
# This was the only YouTube downloader I found that worked. It doesn't
# really have a good Python API so I call it through os.system.
@jgrgt
jgrgt / logstash_pylabs.rb
Created September 14, 2012 09:43
A logstash configuration to track Pylabs 5.1 logs.
input {
stdin {
type => "stdin-type"
}
file {
type => "pylabs"
path => [ "/opt/qbase5/var/log/pylabslogs/*/*.log" ]
}
@jgrgt
jgrgt / pylogcapture.py
Created October 12, 2012 12:17
Pylabs logging Nosetests plugin. Still a WIP!
"""Save at /opt/qbase5/lib/python/site-packages/pylogcapture.py"""
from pylabs import q
from nose.plugins.base import Plugin
from nose.util import ln, safe_str
class PyLogTarget(object):
# TODO: memory management, filtering
enabled = True
@jgrgt
jgrgt / .zshrc
Created March 29, 2013 15:30
My .zshrc
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="kolo"
#ZSH_THEME="nicoulaj"