Skip to content

Instantly share code, notes, and snippets.

View idettman's full-sized avatar

Isaac A. Dettman idettman

View GitHub Profile
@idettman
idettman / jsdoc-external-function-example.js
Created December 9, 2019 08:54
JSDoc external function example
// my-new-type.js
/**
* MyNewType definition
* @typedef {MyNewType} MyNewType
* @param {number} first
* @param {number} second
* @property {function} logFirst
* @property {function} logSecond
* @returns MyNewType
*/
@idettman
idettman / jsdoc-exports-example.js
Created December 9, 2019 08:15
JSDoc exports example
'use strict';
/**
* Creates an instance of the StatusCodeErrorItem
* @memberof common
* @constructor
* @classdesc A class for holding information about an error. The params object allows the tracking of the function
* parameters that caused the error, but should not be used to store large objects.
* @description Creates an instance of the StatusCodeErrorItem with the given message and optional params object
* @param {string} message The message for this error
@idettman
idettman / finally.js
Created September 5, 2019 10:05
JS Optimized Promise
/**
* @this {Promise}
*/
function finallyConstructor(callback) {
var constructor = this.constructor;
return this.then(
function(value) {
// @ts-ignore
return constructor.resolve(callback()).then(function() {
return value;
@idettman
idettman / mac-terminal-commands.md
Last active July 27, 2019 15:02
MacOS Terminal Commands

Finder

Show hidden folders/files SHIFT + CMD + .

Terminal

Man

Exit man q

@idettman
idettman / karma-chai-examples.md
Created July 17, 2019 20:40
JavaScript Karma Chai Usage Examples
@idettman
idettman / nvm-notes.md
Last active June 20, 2019 20:59
NVM Notes

V<^

NVM

Migrating global packages while installing

If you want to install a new version of Node.js and migrate npm packages from a previous version:

nvm install node --reinstall-packages-from=node

@idettman
idettman / commit-message-examples.md
Last active June 7, 2019 09:26
Commit Message Examples

2 commits to parent-pointer @andrewiggins

  • Move _depth property to VNode (-3 B)
  • Replace ancestorComponent with parent vnode pointer (+8 B)
  • [tests] test case for FileUtil#delete(Path)
  • [intellij-sh] Remove unnecessary Reformat tag from live templates
  • [platform] drops parallel FileUtil#delete implementation in favor of FileUtilRt delegation
@idettman
idettman / index.html
Created May 16, 2019 04:58
Multiple Particle Effects using DOM
<div id="smoke"></div>
<div id="flames"></div>
<div id="skyshot"></div>
@idettman
idettman / script.js
Created May 16, 2019 04:58
WebGL Smoke
var camera, scene, renderer,
geometry, material, mesh;
init();
animate();
function init() {
stats = new Stats();
stats.setMode(0);
stats.domElement.style.position = 'absolute';
@idettman
idettman / index.html
Created May 16, 2019 04:57
Smoke Particles
<canvas id="canvas"></canvas>
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAAArwAAAK8AFCrDSYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1E