Skip to content

Instantly share code, notes, and snippets.

Dave Clayton davedx

Block or report user

Report or block davedx

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View delete vs null
let cache1 = {}, cache2 = {}
const blob = () => {
var d = []
for (var i=0; i<10; i++) {
d[i] = Math.random()
}
return d
}
View getter_perf.js
var A = {
_propA: 'fish',
_propB: `cat${this._propA}`
}
var B = {
_propA: 'fish',
_propB: 'cat',
get propA() {
return this._propA
View vandebron_form.json
{
"clientNumber": "061234567890",
"name": "John Doe",
"birthDate": "1994-06-07T00:00:00.000",
"telephoneNumber": "06-22609703"
}
View gist:10102954
<!doctype html>
<html>
<head>
<style type="text/css">
html {
width: 100%;
height: 100%;
margin: 0px;
padding: 0px;
overflow: hidden;
@davedx
davedx / gist:9929388
Created Apr 2, 2014
Display FPS using requestAnimationFrame
View gist:9929388
var lastCalledTime;
var fps;
function requestAnimFrame(t) {
if(!lastCalledTime) {
lastCalledTime = new Date().getTime();
fps = 0;
} else {
delta = (t - lastCalledTime)/1000;
View gist:7891611
// cycle through "myArray" in "dir" (-1 or +1), wrapping around
var nextIdx = (currentIdx + dir) % myArray.length;
if(nextIdx < 0) nextIdx = myArray.length - 1;
You can’t perform that action at this time.