Skip to content

Instantly share code, notes, and snippets.

View akhoury's full-sized avatar
🏠
Working from home

Aziz Khoury akhoury

🏠
Working from home
View GitHub Profile
@akhoury
akhoury / check-promise.js
Last active April 10, 2019 14:31
How to test if an object is promise in the real world
// you must install the 3 modules for this to work
// npm install bluebird q when
// so the gist here, no pun intended, is that when you're testing for a Promise, it's totally fine
// to either check if the object is instanceof Promise or even if Promise.resolve(object) == object
// UNLESS there is a chance that this promise is returned from a third party promise library, or even
// if you have plugins or some other modules using your module,
// ... so, if you don't know which "Promise" constructor could be getting,
/*
// from bootstrap/scss/_variables.scss
$grid-breakpoints: (
xs: 0,
sm: 576px,
md: 768px,
lg: 992px,
xl: 1200px
) !default;
(function () {
// By joseph khoury
let context = new AudioContext();
let sound = context.createOscillator();
sound.type = "sine";
sound.connect(context.destination);
sound.frequency.value = 200;
sound.start();
let ison = true;