View server.js
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
'use strict'; | |
let http = require('http'), | |
url = require('url'), | |
querystring = require('querystring'), | |
fs = require('fs'), | |
editorIndex = 'editor/editor.html', | |
port = parseInt(process.argv[2] || 8080, 10); | |
View plugins.json.js
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
ig.module( | |
'plugins.json' | |
) | |
.defines(function(){ "use strict"; | |
ig.JSON = ig.Class.extend({ | |
data: null, | |
path: '', | |
View xibalba-door-entity.js
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
ig.module( | |
'game.entities.door' | |
) | |
.requires( | |
'plugins.twopointfive.entity' | |
) | |
.defines(function(){ | |
EntityDoor = tpf.Entity.extend({ | |
type: ig.Entity.TYPE.NONE, |
View gist:50672afc9bd6ceb36a3e
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
ig.module( | |
'plugins.gamepad' | |
) | |
.requires( | |
'impact.input', | |
'impact.game' | |
) | |
.defines(function(){ | |
// Assign some values to the Gamepad buttons. We use an offset of 256 |
View gist:0386df6db79386b9c5cc
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
// idbsimple - tiny wrapper around indexeDB to behave like an | |
// asynchronous localStorage. | |
// API (all callbacks are optional): | |
// idbsimple.getItem(key, function(error, value){...}); | |
// idbsimple.setItem(key, value, function(error){...}); | |
// idbsimple.removeItem(key, function(error){...}); | |
// idbsimple.clear(function(error){...}); | |
// idbsimple.delete(); |
View gist:10671262
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
#include <stdio.h> | |
#include <stdbool.h> | |
#include <stdlib.h> | |
#include <ctype.h> | |
#include <string.h> | |
typedef union { | |
unsigned int hex; | |
struct { | |
unsigned char r, g, b, a; |
View gist:5967844
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
#include <stdlib.h> | |
#include <string.h> | |
#include <unistd.h> | |
#include <sys/ioctl.h> | |
#include <arpa/inet.h> | |
#include <net/if.h> | |
void ip_for_interface(const char *interface_name, char *ip, const int length) { | |
*ip = NULL; | |
View OBJLoader.js
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
/** | |
* @author mrdoob / http://mrdoob.com/ | |
*/ | |
THREE.OBJLoader = function () { | |
THREE.EventDispatcher.call( this ); | |
}; |
View gist:5249534
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
var video = document.createElement('video'); | |
console.log( 'can play mp4', video.canPlayType('video/mp4') ); | |
video.src = 'test.mov'; | |
// Also loads from the internet: | |
//video.src = 'http://km.support.apple.com/library/APPLE/APPLECARE_ALLGEOS/HT1211/sample_iTunes.mov'; | |
// Show playback controls: | |
//video.controls = true; |
NewerOlder