This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef struct{ | |
ALuint ID; | |
stb_vorbis* stream; | |
stb_vorbis_info info; | |
ALuint buffers[2]; | |
ALuint source; | |
ALenum format; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--[[ | |
The following example illustrates string interpolation [1] | |
by way of a preprocessor that runs as a customer searcher | |
function in package.loaders. | |
Tested in Lua 5.2.0-beta. | |
Depends on | |
file_slurp https://gist.github.com/1325400 (for loading files simply) | |
luabalanced https://github.com/davidm/lua-balanced (for Lua parsing) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// bind gloss {label:"Gloss", default:0.5, max:1, step:0.01} | |
// bind cdiff {label:"Diffuse Colour", r:0.6, g:0.0, b:0.0} | |
// bind cspec {label:"Specular Colour", r:0.3, g:0.3, b:0.3} | |
// bind lightstrength {label:"Light Strength", default:3, max:100, step:0.1} | |
// bind envtop {label:"Environment Top", r:0.0, g:0.2, b:0.4} | |
// bind envmiddle {label:"Environment Middle", r:0.2, g:0.2, b:0.2} | |
// bind envbottom {label:"Environment Bottom", r:0.01, g:0.1, b:0.01} | |
// bind refractiveindex {label:"Refracive Index", default:1.5, max:3, step:0.1} | |
// bind normalmap {label:"Normal Map", default:false} | |
// bind diffuse {label:"Diffuse", default:true} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# Python program that can send out M-SEARCH messages using SSDP (in server | |
# mode), or listen for SSDP messages (in client mode). | |
import sys | |
from twisted.internet import reactor, task | |
from twisted.internet.protocol import DatagramProtocol | |
SSDP_ADDR = '239.255.255.250' |
OlderNewer