Skip to content

Instantly share code, notes, and snippets.

Nathan Craike ncraike

Block or report user

Report or block ncraike

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ncraike
ncraike / xinitrc
Created Aug 11, 2013
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
View xinitrc
#!/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 Dec 20, 2015
Random snippet from OrderedDict discussion with @nathan_hoad
View gist:6129004
>>> 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>,
You can’t perform that action at this time.