Skip to content

Instantly share code, notes, and snippets.

View wridgers's full-sized avatar

Will Ridgers wridgers

View GitHub Profile
@wridgers
wridgers / tlds.txt
Created March 3, 2012 23:14
A list of all internet top level domains, line by line.
.aero
.asia
.biz
.cat
.com
.coop
.info
.int
.jobs
.mobi
@wridgers
wridgers / dtm.c
Created March 28, 2012 23:41
a pretty small c deterministic turing machine
// could probably be much smaller given some work.
// compressed version
#include <stdio.h>
#define w while
#define b break
int i,j;char s='S',d[]="S0a0>S1a0>a0a0>a1a0>a-H--";struct t{t*l;t*r;char v;};
int main(int c, char**v){t*h=0;w(v[1][j]){t*n=new t;n->v=v[1][j];n->l=h;n->r=0;if(h)h->r=n;
h=n;++j;}w(1){if(!h->l)b;h=h->l;}w(1){if(s=='H')b;i=0;w(d[i]){if(s==d[i]&&h->v==d[i+1]){
s=d[i+2];h->v=d[i+3];t*m=new t;m->v='-';if(d[i+4]=='<'){if(!h->l){m->l=0;m->r=h;h->l=m;}
@wridgers
wridgers / gq.sh
Created April 26, 2012 20:41
Leach lots of GQ videos, in HD.
#!/bin/sh
for i in `seq 1 10`;
do
wget -q "http://www.youtube.com/user/goingquantum/videos?page=$i" -O page.$i.txt
done
cat page.*.txt > total.txt
grep -o "/watch?v=\([^\"\&]*\)" total.txt | sed 's/\/watch?v=//g' | uniq > ids.txt
reddit.com
ycombinator.com
facebook.com
imgur.com
twitter.com
bbc.co.uk
channel4.com
youtube.com
sipRound : [4][64] -> [4][64];
sipRound [v0 v1 v2 v3] = [v0_3 v1_4 v2_3 v3_4]
where {
v0_1 = v0 + v1;
v1_1 = v1 << 13;
v1_2 = v1_1 ^ v0_1;
v0_2 = v0_1 << 32;
v2_1 = v2 + v3;
v3_1 = v3 << 16;
@wridgers
wridgers / gist:3086828
Last active October 7, 2015 01:57
My vim keyboard reference file
-------- vim-commands ----------------------------------------------------------
// BASIC CONTROL
hjkl - move
i - insert mode
R - replace mode
o - insert new line below
O - insert new line above
// LINE MOTIONS
0 - start of line
@wridgers
wridgers / restRootPass.sh
Created July 19, 2012 08:55
A mysql password recovery utility.
#!/bin/bash
#
# resetRootPass script
#
# Recover lost root password of mysql database.
#
# By Willem Bermon
#
echo
" disable those fuckin' arrow keys
inoremap <Up> <NOP>
inoremap <Down> <NOP>
inoremap <Left> <NOP>
inoremap <Right> <NOP>
noremap <Up> <NOP>
noremap <Down> <NOP>
noremap <Left> <NOP>
noremap <Right> <NOP>
import android
import datetime
import json
import urllib
droid = android.Android()
# Configuration options
name = "YOUR_NAME"
weatherSearch = "A_CODE" # UK post code, US zip code, lat/lon
@wridgers
wridgers / MCAPI.php
Created October 18, 2012 12:15
MCAPI - patched by wridgers
<?php
// MCAPI - patched by wridgers (https://github.com/wridgers)
// This patch makes the MCAPI OO friendly, and easy to integrate into projects like Symfony2.
namespace MailChimp;
class MCAPI {
public $version = "1.3";
public $errorMessage;