Skip to content

Instantly share code, notes, and snippets.

@typpo
typpo / .gitconfig
Last active August 29, 2015 13:57
.gitconfig
[user]
name = Ian Webster
email = [email protected]
[diff]
tool = vimdiff
[color]
ui = auto
diff = auto
@typpo
typpo / tree.md
Created March 11, 2014 03:58 — forked from hrldcpr/tree.md

One-line Tree in Python

Using Python's built-in defaultdict we can easily define a tree data structure:

def tree(): return defaultdict(tree)

That's it!

@typpo
typpo / vimrc
Last active August 29, 2015 14:00
set nocompatible
set backspace=indent,eol,start
set cul " cursor line
set cpo+=J
" causes python problems:
" set smartindent
" inoremap # X^H#
set cindent
@typpo
typpo / obfuscated.c
Last active August 29, 2015 14:00
obfuscated
#define _ 0xBEE7
#define print(str)'='//;printf\("You guessed: %s\n", str\);
#include <stdio.h>
#define f(X) int
union fi {f(fi) x; char y;}i;int main() {f(10) ff=10;for (i.x=0; (long)i.x < 1+
4*19*643-_+ff;){if(!i.x++ & _< ff)z:if (putchar(ff) && _)return ff;}print([x
for x in set(ff)]);printf("%d", (f(.))i.x);f(1) x;sscanf("22","%d", &x);
sprintf(&i.y, "%c", print(ff));printf("%c%c", putchar(print(4__2)),i.y);
print(__);f(fi{for(;;)}) y;putchar('Z'-x);goto z;}
@typpo
typpo / caps lock escape swap
Created May 13, 2014 20:44
caps lock escape swap
! Swap caps lock and escape
remove Lock = Caps_Lock
keysym Escape = Caps_Lock
keysym Caps_Lock = Escape
add Lock = Caps_Lock
@typpo
typpo / focus follows mouse
Last active August 29, 2015 14:01
focus follows mouse
gsettings set org.gnome.desktop.wm.preferences focus-mode 'mouse'
gconftool-2 --type boolean --set /apps/metacity/general/auto_raise false
@typpo
typpo / rapchat iframe
Last active August 29, 2015 14:07
rapchat iframe
<div style="position: fixed; bottom: 0; right: 0; height: 400px; width: 300px; z-index: 9999;"><iframe height="400" width="300" src="http://ianww.com/rapchat?r=arthena&iframe=1"></iframe></div>
@typpo
typpo / vimrc
Created September 19, 2015 01:06
set nocompatible
filetype off
set backspace=indent,eol,start
set cul " cursor line
set cpo+=J
" causes python problems:
" set smartindent
" inoremap # X^H#
@typpo
typpo / winxp.desktop
Created October 10, 2015 22:51
Play the winxp sound when you login to xfce (in .config/autostart)
[Desktop Entry]
Encoding=UTF-8
Version=0.9.4
Type=Application
Name=Windows XP sound effect
Comment=
Exec=bash /home/ian/winxp.sh
OnlyShowIn=XFCE;
StartupNotify=false
Terminal=false
set nocompatible
filetype off
set backspace=indent,eol,start
" Exit visual mode without delay.
set timeoutlen=1000 ttimeoutlen=0
set cul " cursor line
set cpo+=J