Skip to content

Instantly share code, notes, and snippets.

/*
* object.watch polyfill
*
* 2012-04-03
*
* By Eli Grey, http://eligrey.com
* Public Domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/
@narfman0
narfman0 / pubsubcutioner.min.js@1.1.2
Created February 19, 2016 18:48
pubsubcutioner 1.1.2
!function(n,e){"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?module.exports=e():n.Pubsubcutioner=e()}(this,function(){function n(){function n(n){var t=[];for(var r in e)new RegExp("^"+r+"$").test(n)&&(t=t.concat(e[r]));return t}var e={},t={};return t.publish=function(e,t){var r,o=n(e);for(r in o)if(o.hasOwnProperty(r))try{o[r](e,t)}catch(i){"undefined"!=typeof console&&console.log(i.stack)}return!0},t.subscribe=function(n,t){return"function"!=typeof t?!1:(e.hasOwnProperty(n)||(e[n]=[]),e[n]=e[n].concat(t),!0)},t.clearAllSubscriptions=function(){e={}},t.clearSubscriptions=function(n){var t;for(t in e)e.hasOwnProperty(t)&&0===t.indexOf(n)&&delete e[t]},t.unsubscribe=function(n){var t,r,o,i="string"==typeof n&&e.hasOwnProperty(n),u="function"==typeof n,f=!1;if(i)return void delete e[n];for(t in e)if(e.hasOwnProperty(t)&&(r=e[t],u))for(o in r)r.hasOwnProperty(o)&&r[o]===n&&(delete r[o],f=!0);return f},"undefined"!=typeof window&&(window.pubsubcutioner=t),t}return n()});
@narfman0
narfman0 / serverless
Created June 28, 2018 13:41 — forked from davidgf/serverless
Bash completion for Serverless
_sls()
{
local cur prev words cword
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
words="${COMP_WORDS}"
local COMMANDS=(
"project"

Keybase proof

I hereby claim:

  • I am narfman0 on github.
  • I am narfman0 (https://keybase.io/narfman0) on keybase.
  • I have a public key whose fingerprint is 81CB A84D DA05 3B11 E9BD 387C 98A2 BB30 33AC 247B

To claim this, I am signing this object: