Skip to content

Instantly share code, notes, and snippets.

View christopherdebeer's full-sized avatar

Christopher de Beer christopherdebeer

View GitHub Profile
@christopherdebeer
christopherdebeer / index.js
Created February 18, 2013 13:17
voxel.js game
var createGame = require('voxel-engine')
function sphereWorld(x, y, z) {
// return the index of the material you want to show up
// 0 is air
if (x*x + y*y + z*z > 15*15) return 0
return 3
}
var game = createGame({
var app = {
version: 1
init: function(){prompt(hmmm a no url app, what do you think?);}
}
@christopherdebeer
christopherdebeer / soorted sets (z).sh
Created November 3, 2012 13:13
sorted sets from redis and intended usage pattern
Last login: Sat Nov 3 12:48:23 on ttys000
redxiii:~ christopherdebeer$ redis-cli
redis 127.0.0.1:6379> set x 2
OK
redis 127.0.0.1:6379> get x
"2"
redis 127.0.0.1:6379> sadd test 2
(integer) 1
redis 127.0.0.1:6379> smembers test
1) "2"
/*
* Javascript EXIF Reader 0.1.4
* Copyright (c) 2008 Jacob Seidelin, cupboy@gmail.com, http://blog.nihilogic.dk/
* Licensed under the MPL License [http://www.nihilogic.dk/licenses/mpl-license.txt]
*/
var EXIF = {};
(function() {
/*
* Javascript EXIF Reader 0.1.4
* Copyright (c) 2008 Jacob Seidelin, cupboy@gmail.com, http://blog.nihilogic.dk/
* Licensed under the MPL License [http://www.nihilogic.dk/licenses/mpl-license.txt]
*/
var EXIF = {};
(function() {
@christopherdebeer
christopherdebeer / gist:3394765
Created August 19, 2012 13:23
text selection bookmarklet code unminified from marksaved.com
//javascript:
(function () {
var enc = encodeURIComponent;
var s = window.getSelection();
if (location.href == "http://marksaved.com/welcome") {
alert("Drag this button to the toolbar to start highlighting")
} else if (s && encodeURIComponent(s).length > 1300) {
alert("Sorry, you can only highlight up to 1K characters")
} else {
var d = document;
@christopherdebeer
christopherdebeer / error.md
Created August 18, 2012 16:08
Cordova 2.0.0 Error OSX

#Cordova 2.0.0 Error OSX

Calling: sudo ./create ~/cordovatest com.christopherdebeer.test01 testapp *

  • When in the /bin/ folder of Cordova-2.0.0 dmg unpacked from phonegap-phonegap-2.0.0-0-g2dbbdab.zip

Returns the following error:

/Volumes/Cordova-2.0.0/bin/replaces: line 28: tmpFile: Read-only file system mv: tmpFile: No such file or directory
@christopherdebeer
christopherdebeer / index.js
Created July 17, 2012 15:59 — forked from aemkei/index.js
Obfuscate JS
// RUN THIS IN JAVASCRIPT
([]+{}+[])[!!{}+![]]+([]+
{}+[])[!!{}+!![]]+(!{}+[]
)[!{}+![]]+([][{}]+[])[!{
}+![]]+(!{}+[])[![]+!!{}+
!!{}+!![]]+({}+{})[(!!{}+
!![])*(!!{}+!![])+!!{}]+(
{}-{}+[])[!!{}+![]]+([]+!
!{})[!{}+![]]+([]+!!{})[!
@christopherdebeer
christopherdebeer / layout2.jade
Created July 9, 2012 15:23 — forked from kmiyashiro/layout2.jade
HTML5 Boilerplate Conditional comments in Jade
!!! 5
//if lt IE 7
html(class="no-js ie6 oldie", lang="en")
//if IE 7
html(class="no-js ie7 oldie", lang="en")
//if IE 8
html(class="no-js ie8 oldie", lang="en")
// [if gt IE 8] <!
html(class="no-js", lang="en")
// <![endif]
@christopherdebeer
christopherdebeer / gist:2331687
Created April 7, 2012 19:56 — forked from mikeal/gist:2331127
safe .toJSON()
function getSafe (self, uuid) {
if (typeof self === 'object' || typeof self === 'function') var safe = {}
if (Array.isArray(self)) var safe = []
var recurse = []
Object.defineProperty(self, uuid, {})
var attrs = Object.keys(self).filter(function (i) {
if (i === uuid) return false