Skip to content

Instantly share code, notes, and snippets.

View eskimoblood's full-sized avatar
🙀
snafu

Andreas Köberle eskimoblood

🙀
snafu
View GitHub Profile
dojo.provide("dojox.mustache._Templated");
dojo.require("dijit._Widget");
dojo.require("dijit._Templated");
//
// INSTALL: copy http://github.com/janl/mustache.js to this folder as _base.js
// Add dojox.mustache = dojo.hitch(Mustache, "to_html") in _base.js, wrapping
// the whole file in a self-executing-anonymous-function. eg:
//
// dojo.provide("dojox.mustache._base");
// (function(){
!function() {
var doc = document,
htm = doc.documentElement,
lct = null, // last click target
nearest = function(elm, tag) {
while (elm && elm.nodeName != tag) {
elm = elm.parentNode;
}
return elm;
};
@banksean
banksean / perlin-noise-classical.js
Created February 15, 2010 10:00
two Perlin noise generators in javascript. The simplex version is about 10% faster (in Chrome at least, haven't tried other browsers)
// Ported from Stefan Gustavson's java implementation
// http://staffwww.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf
// Read Stefan's excellent paper for details on how this code works.
//
// Sean McCullough banksean@gmail.com
/**
* You can pass in a random number generator object if you like.
* It is assumed to have a random() method.
*/