Skip to content

Instantly share code, notes, and snippets.

View sebbdk's full-sized avatar
Developing ad libitum

Sebastian Vargr sebbdk

Developing ad libitum
View GitHub Profile
<?LOL
HAI;
PLZ SHOWS ALL UR VARS;
YINz CAN HAS VARS++;
OK SO $THIS IZ A LOOP
{
(( WOW YINz JAGOFF;)
i CAN HAZz BA$$;
(123 CHECK ITZ;)
@sebbdk
sebbdk / gist:6213684
Last active December 20, 2015 23:38
Convo
{
people:[
{
name:'Narrator'
},
{
name:'Bill Port'
isPlayer:true
}
],
@sebbdk
sebbdk / Grid collision detection
Last active December 14, 2015 17:59
Get collision point on the normal of a block in a grid
//Calculate intersection point in grid
var V = {x:1, y:-1, z:0, w:1}; //direction
var A = {x:1.5, y:1.5, z:0}; //point or origin
var n = {x:0, y:1, z:0, w:1}; //normal
var b = {x:2, y:0, z:0}; //grid block position
var rp = {x:null, y:null, z:null}; //result position
var mid = (A.x * Math.abs(n.x) + A.y * Math.abs(n.y) + A.z * Math.abs(n.z)) - (b.x * Math.abs(n.x) + b.y * Math.abs(n.y) +b.z * Math.abs(n.z) + n.w);
@sebbdk
sebbdk / gist:5013720
Created February 22, 2013 14:18
Problem solving
Does it work with clean cookies?
Can it be done the reverse way?
Can you reset and start over?
Check DNS settings
Hidden syntax error?
have you tried simplifying the code bug more?
have you tried removing all excess code to find the bug origin?
package
{
import asset.BadGermGraph;
import away3d.animators.UVAnimationSet;
import away3d.animators.UVAnimationState;
import away3d.animators.UVAnimator;
import away3d.animators.data.UVAnimationFrame;
import away3d.animators.nodes.UVClipNode;
import away3d.containers.View3D;
function test() {
var _self = this;
function subFunction() {
this;//refers to subFunction()
_self;// refers to test()
}
subFunction();
}
// Numbers with a leading 0 use a radix of 8 (octal)
var result = parseInt('0101');
// Numbers that start with 0x use a radix of 16 (hexidecimal)
var result = parseInt('0x0101');
// Numbers starting with anything else assumes a radix of 10
var result = parseInt('101');
// Or you can specify the radix, in this case 2 (binary)
console.log( 1 === true );//returns false
console.log( 1 == true );//returns true
test = "hello";
function testSomething() {
var test = "world"
}
testSomething();
console.log(test);//returns "hello"