Skip to content

Instantly share code, notes, and snippets.

View Jan-Ka's full-sized avatar
🧙‍♂️
Code around, find out

Jan Ka Jan-Ka

🧙‍♂️
Code around, find out
View GitHub Profile
@Jan-Ka
Jan-Ka / 843hvk.js
Created March 13, 2018 14:05
Code to test speed differences between loops in response to "17 JavaScript / node.js performance coding tips to make applications faster"
// https://www.reddit.com/r/node/comments/843hvk/17_javascript_nodejs_performance_coding_tips_to/
var arr = [];
arr[0] = 20;
arr[10] = undefined;
arr[434] = 200;
var noop = () => {};
console.time("for");
@Jan-Ka
Jan-Ka / Guid.ts
Created May 14, 2017 20:24
TypeScript UUIDv4 Generator Class
/**
* Guid Class
*
* @export
* @class Guid
* @see {@link https://gist.github.com/jed/982883}
*/
export class Guid {
private value: string;
@Jan-Ka
Jan-Ka / maxWidth-test.js
Created February 24, 2017 12:43
Create a div that is set to Number.MAX_SAFE_INTEGER (fallback to Number.MAX_VALUE) to see how far it will be rendered
(function () {
console.log("maxWidth test running");
// in calling HTML - ensure that a div with id jsTest is available
let maxWidthDiv = document.querySelector("#jsTest");
let maxWidthVal = "1337px";
if(Number.MAX_SAFE_INTEGER) {
maxWidthVal = Number.MAX_SAFE_INTEGER.toString() + "px";
} else {