Skip to content

Instantly share code, notes, and snippets.

@iamgreaser
iamgreaser / sdlavx2dgridcast.c
Created April 20, 2012 08:47
AVX 2d grid caster
/*
incomplete AVX-based SDL 2d-grid raycaster engine
by Ben "GreaseMonkey" Russell, 2012. public domain.
*/
// note to intel: who the hell named these?!?! (also why isn't AVX "ymmintrin")
#include <mmintrin.h> /* MMX */
#include <xmmintrin.h> /* SSE */
@ijt
ijt / logging_example.hs
Created June 29, 2011 03:10
Example of logging in Haskell
#!/usr/bin/env runhaskell
-- This example uses the hslogger library.
-- For debugging it may be more convenient to use Debug.Trace instead since that
-- allows you to log debugging output from otherwise pure functions.
import System.IO (stderr, Handle)
import System.Log.Logger (rootLoggerName, setHandlers, updateGlobalLogger,
Priority(INFO), Priority(WARNING), infoM, debugM,
warningM, errorM, setLevel)
@avsej
avsej / gist:741722
Created December 15, 2010 07:12
build ruby for arm platform (e.g. for amazon kindle)
echo "deb http://emdebian.org/debian/ lenny main" >> /etc/apt/sources.list
apt-get update
apt-get install binutils-arm-linux-gnueabi gcc-4.3-arm-linux-gnueabi libc6-dev-armel-cross
cd /path/to/ruby/1.8.7/sources
autoconf
CFLAGS="--static" LDFLAGS="--static" CC="arm-linux-gnueabi-gcc" ac_cv_func_setpgrp_void=yes ac_cv_func_isinf=no ac_cv_func_isnan=no ac_cv_func_finite=no CROSS_COMPILING=1 ./configure --host="arm-linux-gnueabi" --prefix=/mnt/us/opt
make
make install