Skip to content

Instantly share code, notes, and snippets.

#include "stdafx.h"
#include "SDL.h"
#include "SDL_video.h"
enum Ingredients
{
CARROT = 1,
CHEDDAR = 2,
CAPSICUM = 4,
FETTA = 8,
#include "stdafx.h"
#include "SDL.h"
#include "SDL_opengl.h"
#include "SDL_video.h"
#include <cmath>
enum Ingredients
{
CARROT = 1,
CHEDDAR = 2,
s = net.createServer(function(c) { c.setEncoding('utf8'); c.on('data', function(data){console.log('packet: ', data)}); })
canvas = document.getElementsByTagName('canvas')[0]
fpselem = document.getElementById 'fps'
canvas.width = 800
canvas.height = 600
gl = canvas.getContext('webgl') or canvas.getContext('experimental-webgl')
triBuf = gl.createBuffer()
gl.bindBuffer gl.ARRAY_BUFFER, triBuf
tverts = new Float32Array [
0, 1, 0, 1,0,0,
@josephg
josephg / Results
Created August 26, 2012 06:07
Librope vs SGI ropes vs C strings
$ ./a.out -b
Benchmarking...
benchmarking librope
did 500000 iterations in 157.574000 ms: 3.173112 Miter/sec
final string length: 5799
benchmarking c string
did 500000 iterations in 1556.024000 ms: 0.321332 Miter/sec
final string length: 5799
@josephg
josephg / Result
Created August 28, 2012 07:55
CFStringDelete bug
$ clang -framework CoreFoundation test.c
$ ./a.out
The string should be "a". It is ""
@josephg
josephg / _.md
Created March 6, 2013 03:10
perlin anim
@josephg
josephg / _.md
Created March 27, 2013 02:39
Tributary inlet
var console = {log: print};
var iter;
var read = function(callback) {
iter = callback();
iter.next(); // Start the function, and run until it blocks.
};
var ondata = function(data) {
iter.send(data);
@josephg
josephg / default.vcl
Created May 29, 2013 19:01
varnish query parameter balancing
# This is a basic VCL configuration file for varnish. See the vcl(7)
# man page for details on VCL syntax and semantics.
#
# Default backend definition. Set this to point to your content
# server.
#
import std;
backend s1 {
.host = "127.0.0.1";