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($){ | |
/* | |
ajaxDummyResponse.js | |
TF 2012 | |
Let frontenders using jquery play around with dummy ajax responses | |
instead of waiting for backenders in an easy way... | |
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
/* | |
aFrame - | |
a small library using requestAnimationFrame | |
for smoother setIntervals and setTimeouts... | |
© Thomas Frank, Nodebite 2014 | |
Works as a dropin replacement for | |
setInterval, setTimeout, clearInterval and clearTimeout |
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
// ------------------------------------------------------- | |
// LESS-reg-js 1.0 | |
// (c) Nodebite 2014, Thomas Frank | |
// MIT license, free to use everywhere. | |
// | |
// Register a JavaScript as a LESS function. | |
// (Yes! This is valid LESS!) | |
// | |
// ------------------------------------------------------- | |
// |
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 getFileNames(path,callback){ | |
// Read a folder recursively looking for js files | |
var fs = require('fs'), base = {__count:0, arr: []}; | |
recursiveReadDir(path); | |
// Recursor | |
function recursiveReadDir(path){ | |
base.__count++; | |
fs.readdir(path,function(err,x){ | |
base.__count--; |
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
// A minimal polyfill for Object.assign | |
// (an ES6 feature) | |
Object.assign = Object.assign || function(){ | |
for(var i = 1; i < arguments.length; i++){ | |
for(var j in arguments[i]){ | |
arguments[0][j] = arguments[i][j]; | |
} | |
} | |
}; |
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
// JavaScript has prototypical inheritance | |
// so there is no real difference in extending | |
// something or creating a new instance | |
// (although the new keyword may have tricked you | |
// into thinking so) | |
var debug = true; | |
// A minimal polyfill for Object.assign |
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
// A minimal polyfill for Object.assign | |
// (an ES6 feature) | |
Object.assign = Object.assign || function(){ | |
for(var i = 1; i < arguments.length; i++){ | |
for(var j in arguments[i]){ | |
arguments[0][j] = arguments[i][j]; | |
} | |
} | |
}; |
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
/* | |
Five Programming Problems | |
a software developer should be able | |
to solve in less than an hour | |
https://blog.svpino.com/2015/05/07/five-programming-problems-every-software-engineer-should-be-able-to-solve-in-less-than-1-hour | |
Thomas Frank, Solutions in JS, time taken: | |
45 minutes (almost all time spent on problem 4 and 5) | |
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
/* | |
A deep copier for JavaScript | |
that can handle circular references, | |
copies objects with correct prototypes, | |
copies functions (rather than referencing them), | |
copies non-enumerable properties | |
and copies HTML- and jQuery-elements as references | |
*/ | |
function deepCopy(obj){ |
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
/* | |
jQuery.collides plugin: collides | |
- simple collisionDetection | |
© 2014 Thomas Frank, v 0.7b | |
Check if one or more objects (DOM elments) collides | |
with one or more other objects (DOM elements) | |
If object collides the callbackFunc will be triggered. |
OlderNewer