Skip to content

Instantly share code, notes, and snippets.

View primitiveshaun's full-sized avatar

Shaun Knowles primitiveshaun

View GitHub Profile
@primitiveshaun
primitiveshaun / cancellable-wait.js
Created October 8, 2019 08:06 — forked from ericelliott/cancellable-wait.js
Cancellable wait -- an ES6 promise example
const wait = (
time,
cancel = Promise.reject()
) => new Promise((resolve, reject) => {
const timer = setTimeout(resolve, time);
const noop = () => {};
cancel.then(() => {
clearTimeout(timer);
reject(new Error('Cancelled'));
@primitiveshaun
primitiveshaun / wait.js
Created October 8, 2019 08:17 — forked from ericelliott/wait.js
Wait -- an ES6 promise example
const wait = time => new Promise((resolve) => setTimeout(resolve, time));
wait(3000).then(() => console.log('Hello!')); // 'Hello!'
// Class Inheritance Example
// NOT RECOMMENDED. Use object composition, instead.
// https://gist.github.com/ericelliott/b668ce0ad1ab540df915
// http://codepen.io/ericelliott/pen/pgdPOb?editors=001
class GuitarAmp {
constructor ({ cabinet = 'spruce', distortion = '1', volume = '0' } = {}) {
Object.assign(this, {
cabinet, distortion, volume
@primitiveshaun
primitiveshaun / svn-commands.sh
Last active March 31, 2020 08:16
SVN Commands Reference
# svn-commands.sh
# *** HOUSEKEEPING! We all live in a yellow svn repository, a yellow svn repository... ***
# Master File: Maintained by Primitive Digital's Housekeeping Department
# https://primitivedigital.uk/housekeeping-department/
# STATUS ::: DRAFT: Requires Review
# version of svn
$ svn --version
@primitiveshaun
primitiveshaun / node-commands.sh
Created March 31, 2020 08:31
Node.js - NPM Commands Reference
# node-commands.sh
# *** HOUSEKEEPING! One for the Node ***
# Master File: Maintained by Primitive Digital's Housekeeping Department
# https://primitivedigital.uk/housekeeping-department/
# STATUS ::: DRAFT: Requires Review
# version of npm
$ npm --version
$ npm -v
# git-commands.sh
# *** HOUSEKEEPING! Cheeky Git! ***
# Master File: Maintained by Primitive Digital's Housekeeping Department
# https://primitivedigital.uk/housekeeping-department/
# STATUS ::: DRAFT: Requires Review
# version of git
$ git --version
@primitiveshaun
primitiveshaun / pd_primitive.svg
Last active October 16, 2020 11:29
Primitive Theme: SVG PD Brand Text
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@primitiveshaun
primitiveshaun / pd_heartit.svg
Created October 16, 2020 11:31
Primitive Theme: SVG PD Heart
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@primitiveshaun
primitiveshaun / pd_wordpress.svg
Created October 16, 2020 11:50
Primitive Theme: SVG PD WordPress
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@primitiveshaun
primitiveshaun / pd_frontity.svg
Created October 16, 2020 12:03
Primitive Theme: SVG PD Frontity
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.