Skip to content

Instantly share code, notes, and snippets.

@ncraike
ncraike / xinitrc
Created August 11, 2013 13:03
The offending /etc/xdg/xfce4/xinitrc script in my Ubuntu install. The line: cat /dev/null $XRESOURCES | xrdb -nocpp -merge - ...breaks ~/.Xresources which use #define - the -nocpp option disables preprocessor directives
#!/bin/sh
# fix broken $UID on some system...
if test "x$UID" = "x"; then
if test -x /usr/xpg4/bin/id; then
UID=`/usr/xpg4/bin/id -u`;
else
UID=`id -u`;
fi
fi
@ncraike
ncraike / gist:6129004
Last active December 20, 2015 12:09
Random snippet from OrderedDict discussion with @nathan_hoad
>>> od
OrderedDict([('my first key', 'first val'), ('second', 'something'), ('third', 'blah')])
>>> od._OrderedDict__root[0]
[[[[[...], [...], None], [...], 'my first key'], [...], 'second'], [[...], [[...], [[...], [...], 'second'], 'my first key'], None], 'third']
>>> od._OrderedDict__root[1]
[[[[[...], [...], 'second'], [...], 'third'], [...], None], [[...], [[...], [[...], [...], None], 'third'], 'second'], 'my first key']
>>>
>>> from pprint import pprint as pp
>>> pp(od._OrderedDict__root)
[[[[<Recursion on list with id=24188808>,