This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib | |
try: | |
from urlparse import parse_qs | |
except ImportError: | |
from cgi import parse_qs | |
def url_params(url, **kwargs): | |
bits = url.split('?') | |
query_vars = {} | |
if len(bits) > 1: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function drawMap(map) { | |
var x, y, | |
width = map[0].length, | |
current_node = map.length * width; | |
while (current_node--) { | |
x = current_node % width; | |
y = ~~(current_node / width); | |
drawTile({ | |
x: x, | |
y: y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 [email protected] | |
/** | |
* You can pass in a random number generator object if you like. | |
* It is assumed to have a random() method. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function (LocalStorage) { | |
var DELIM = "|"; | |
LocalStorage.readit = function (key) { | |
console.log('FN .get for key', key); | |
var str = localStorage.getItem(key); | |
console.log('get raw=', str); // e.g. 't35' | |
if (str === null || str === ''){ | |
return null | |
} |