Skip to content

Instantly share code, notes, and snippets.

@typpo
typpo / gist:9361188
Created March 5, 2014 04:30
.bashrc
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
PS1='\[$bold$([ $? == 0 ] && echo "$blue" || echo "$red")\]\h\[$reset\]:$PWD\[$green\]$(__git_ps1)\[$reset\]$ '
# clipboard
@typpo
typpo / gist:9361196
Created March 5, 2014 04:30
.bash_aliases
alias l='ls'
alias ls='ls --color=auto'
alias ll='ls -l'
alias vi='vim'
alias rg='grep -r -I --exclude-dir="\.git" --exclude-dir="node_modules"'
if [ -x /usr/bin/colormake ]; then
alias make='colormake'
fi
@typpo
typpo / .gitconfig
Last active August 29, 2015 13:57
.gitconfig
[user]
name = Ian Webster
email = ian@planetaryresources.com
[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#