Skip to content

Instantly share code, notes, and snippets.

View polyclick's full-sized avatar
👽
I see the matrix

polyclick polyclick

👽
I see the matrix
View GitHub Profile
@polyclick
polyclick / classjs-snippet.js
Created July 31, 2015 10:58
classjs init snippet
'use strict';
var ClassName = Class.extend({
init: function() {
// catch arguments here
// init class
}
});
@polyclick
polyclick / jquery-ready-shorthand.js
Created July 23, 2015 13:39
jquery ready shorthand
$(function() {
// Handler for .ready() called.
});
@polyclick
polyclick / scene-boilerplate.js
Created July 20, 2015 12:46
threejs cube boilerplate scene + tweenmax update ticker
'use strict';
function Application() {
this.camera = null;
this.scene = null;
this.renderer = null;
this.mesh = null;
this.init();
}
@polyclick
polyclick / default-parameter.js
Last active August 29, 2015 14:25
javascript default value parameter
param = typeof param !== 'undefined' ? param : default_value;
@polyclick
polyclick / scene-draw-line.js
Last active August 29, 2015 14:19
Draw a line in threejs
// creates a white (!!) line from 0,0,0 to 300,0,0
// make sure background is other color than white ;)
var geometry = new THREE.Geometry();
geometry.vertices.push(new THREE.Vector3(0, 0, 0));
geometry.vertices.push(new THREE.Vector3(300, 0, 0));
var line = new THREE.Line(
geometry,
new THREE.LineBasicMaterial( { color: 0xffffff, linewidth: 1 } )
);