Skip to content

Instantly share code, notes, and snippets.

@klaufir
klaufir / find-symbol-owner.sh
Created May 7, 2015 16:22
Find the owner .so file for a given symbol
#!/bin/bash
find /usr/lib -name '*.so' | xargs -n 1 -I QQQQQQ sh -c "readelf -Ws QQQQQQ 2>&1 | nl -s QQQQQQ | cut -c7-" | grep -v " UND " | grep $*
#example: find-symbol-owner.sh glLight

Clojure Modules HOWTO

Referencing a module from a project

  1. Create new project
    lein new app [appname]
    
iterator imap[T,O](iter: iterator(): T {.closure.}, transform_elem: proc(e:T):O): O {.closure.} =
var iterInst = iter
for x in iterInst():
yield transform_elem(x)
iterator ifilter[T](iter: iterator(): T {.closure.}, filter: proc(e:T):bool): T {.closure.} =
var iterInst = iter
for x in iterInst():
if filter(x):
yield x
@klaufir
klaufir / howto-compile-mono.txt
Last active August 29, 2015 13:57
Mono compilation howto on Ubuntu with Stow
Compile latest Mono on Ubuntu
#1. make sure to have the universe repo, on 14.04 your /etc/apt/sources.list must look like this
deb http://archive.ubuntu.com/ubuntu/ trusty main restricted universe
deb http://security.ubuntu.com/ubuntu/ trusty-security main restricted universe
deb http://archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe
#2. then update your local package index by
apt-get update
@klaufir
klaufir / rteval.lisp
Last active December 31, 2015 16:29
Runtime-eval tests
; SBCL 1.1.12, limit = 10M, 20M, 40M
; 22:37 <fikusz> result: 3.7037042592681206d19
; 22:37 <fikusz> ./lispeval.exe 0.44s user 0.01s system 99% cpu 0.456 total
; 22:38 <fikusz> result: 2.9629631851909926d20
; 22:38 <fikusz> ./lispeval.exe 0.85s user 0.01s system 99% cpu 0.867 total
; 22:38 <fikusz> result: 2.3703704592622897d21
; 22:38 <fikusz> ./lispeval.exe 1.64s user 0.02s system 99% cpu 1.672 total
(defun main-fn ()
@klaufir
klaufir / libcello-notes.md
Created July 18, 2013 18:14
libCello notes
@klaufir
klaufir / GameChangerMain.hx
Created June 21, 2013 11:32
HaxeFlixel crashing after FlxG.switchState
package;
import nme.Lib;
import org.flixel.FlxGame;
import org.flixel.FlxG;
import org.flixel.FlxSprite;
import org.flixel.FlxState;
class GameChangerMain extends FlxGame
{