Skip to content

Instantly share code, notes, and snippets.

View treeform's full-sized avatar

Andre von Houck treeform

View GitHub Profile
mat4 old = uOldGeomMats[int(aGeomIndex)];
mat4 new = uGeomMats[int(aGeomIndex)];
mat4 final;
float a = new[0][0];
float b = old[0][0];
// works :
// final[0][0] = old[0][0];
@treeform
treeform / gist:2727938
Created May 18, 2012 22:34 — forked from miohtama/gist:2727891
Create HTML5 <audio> compatible files out of MP3 using ffmpeg
# -*- coding: utf8 -*-
import os
import subprocess
def create_prelisten_ogg(mp3, ogg):
"""
Run en-code for a single file
Do 48 kbit files for prelisten.
"""
@treeform
treeform / index.html
Created December 5, 2012 16:21 — forked from benjchristensen/index.html
Line graph over time with multiple data points using SVG and d3.js
<html>
<head>
<title>Line graph over time with multiple data points using SVG and d3.js</title>
<script src="http://mbostock.github.com/d3/d3.v2.js"></script>
<style>
body {
font-family: "Helvetica Neue", Helvetica;
}
/* tell the SVG path to be a thin blue line without any area fill */
@treeform
treeform / gist:4746218
Created February 9, 2013 17:36
Cannon.js space ship sample thingy.
<DOCTYPE html>
<html>
<head>
<title>cannon.js - compound demo</title>
<meta charset="utf-8">
<style>* {margin:0;padding:0}</style>
</head>
<body>
<script src="../build/cannon.js"></script>
<script src="../build/cannon.demo.js"></script>
@treeform
treeform / gist:4771953
Created February 12, 2013 18:13
Gruling XML library i wrote.
"""
Example user case:
define rules:
rules = [
("library_images / image id / init_from / *", image),
("library_effects / effect id / profile_COMMON / newparam sid / sampler2D / source / *", effect),
("library_materials / material id name / instance_effect url", material),
import gym
import random
env = gym.make('CartPole-v0')
env.monitor.start('/tmp/cartpole-experiment-3', force=True)
# its simulated annealing like
bestSteps = 0
@treeform
treeform / atlas.nim
Created January 18, 2017 16:22
make atlas
import sdl2
import sdl2.image
import os
import strutils
if not sdl2.init(INIT_EVERYTHING):
quit "Failed start SDL2"
if image.init(IMG_INIT_PNG) == -1:
quit "Failed start SDL2_Image"
/*
* A speed-improved perlin and simplex noise algorithms for 2D.
*
* Based on example code by Stefan Gustavson ([email protected]).
* Optimisations by Peter Eastman ([email protected]).
* Better rank ordering method by Stefan Gustavson in 2012.
* Converted to Javascript by Joseph Gentle.
*
* Version 2012-03-09
*
+------------------+------+
| name | rank |
+------------------+------+
| Godde | 2029 |
| Mode | 1972 |
| Pemtyu | 1843 |
| Apo11o | 1646 |
| raaar | 1639 |
| TheDefiantOne | 1621 |
| 514484 | 1608 |
+---------+---------+
| faction | sum |
+---------+---------+
| N0V4 | 31424 |
| ELYS | 29525 |
| CNCR | 24335 |
| AI | 20686 |
| ISOI | 13966 |
| EVO | 12425 |
| AUTO | 12292 |