This gist is to remind me (and anyone else who it helps) how to quickly disable and re-enable Notification Center.
- Open your terminal (<⌘ + ␣ (spacebar)>, then type "terminal", then press <↩ (enter)>).
// Only trigger enclosing computation if the return value of | |
// f is not EJSON.equals to the previuous return value | |
Tracker.guard = function(f) { | |
if (Meteor.isServer || !Tracker.currentComputation) { | |
return f(); | |
} | |
let dep = new Tracker.Dependency(), | |
curView = Blaze.currentView, | |
tplFunc = Template._currentTemplateInstanceFunc; |
function logClass(target: any) { | |
// save a reference to the original constructor | |
var original = target; | |
// a utility function to generate instances of a class | |
function construct(constructor, args) { | |
var c : any = function () { | |
return constructor.apply(this, args); | |
} |
// array utils | |
// ================================================================================================= | |
const combine = (...arrays) => [].concat(...arrays); | |
const compact = arr => arr.filter(Boolean); | |
const contains = (() => Array.prototype.includes | |
? (arr, value) => arr.includes(value) | |
: (arr, value) => arr.some(el => el === value) |
/* | |
JavaScript Caesar shift | |
by Evan Hahn (evanhahn.com) | |
"Encrypt" like this: | |
caesarShift('Attack at dawn!', 12); // Returns "Mffmow mf pmiz!" | |
And "decrypt" like this: |