Skip to content

Instantly share code, notes, and snippets.

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())
[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
@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
#!/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"
# 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
@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"