Skip to content

Instantly share code, notes, and snippets.

@stevedonovan
stevedonovan / loader.lua
Created October 19, 2011 09:52
A Custom Lua module loader for Lua 5.2
-- This allows a more restricted module() style; the key feature
-- is that each module is loaded in a custom environment, and the actual module
-- table is a copy of that environment after initial load.
-- clone _G so that globals from the program don't invade the module
local lua_libs = {}
for k,v in pairs(package.loaded._G) do
lua_libs[k] = v
end
@veritech
veritech / gist:1224664
Created September 18, 2011 03:02
Brute force HTTP password cracker
#!usr/bin/python
#Linksys WRT54G router brute force
#http://www.darkc0de.com
#d3hydr8[at]gmail[dot]com
import threading, time, random, sys, urllib2, socket
if len(sys.argv) !=4:
print "Usage: ./linksysbrute.py <server> <user> <wordlist>"
sys.exit(1)
@matthewmccullough
matthewmccullough / gist:988077
Created May 24, 2011 03:02
Visualize Git Orphans via gitk and log
# Put this in your .gitconfig file under the alias section
orphank = !gitk --all `git reflog | cut -c1-7`&
# Then run it by typing 'git orphank' on the command line.
# A text version of the same is
orphanl = !git --pretty=oneline --abbrev-commit --graph --decorate `git reflog | cut -c1-7`
@od0x0
od0x0 / gist:965399
Created May 10, 2011 21:17
How I Load a .ogg into OpenAL Using stb_vorbis
typedef struct{
ALuint ID;
stb_vorbis* stream;
stb_vorbis_info info;
ALuint buffers[2];
ALuint source;
ALenum format;
@daurnimator
daurnimator / pointer.lua
Created April 5, 2011 01:28
A small library that will let you use luajit cdata how you would hope.
local ffi=require"ffi"
local topointer
local pointer_mt
local key_address , key_ctype , key_cdata , key_methods = {},{},{},{}
local function ispointer ( ob )
return getmetatable ( ob ) == pointer_mt
end
local function denormalise ( ob )
@sixman9
sixman9 / glCube13vTriangleStripFragC.txt
Created March 2, 2011 16:02
How to draw a cube using 13 Triangle Strip vertices.
How to draw a Cube with OpenGL's Triangle strip (non-Vertex buffer object example, 13 vertices)
gl.glBegin(gl.GL_TRIANGLESTRIP);
gl.glVertex(100,100,−100);
gl.glVertex(100,300,−100);
gl.glVertex(300,300,−100);
gl.glVertex(300,300,−300);
gl.glVertex(300,100,−300);
@nrh
nrh / comp.pl
Created November 8, 2010 04:36
#!/usr/local/bin/perl -w
use Benchmark qw(:all);
use YAML::Syck qw();
use YAML::XS qw();
my @files = ( 'large.yaml', 'medium.yaml', 'small.yaml' );
my $count = $ARGV[0] || 1000;