Skip to content

Instantly share code, notes, and snippets.

@FesterCluck
FesterCluck / sw.js
Created August 16, 2017 18:30
serviceworker logger
self.addEventListener('install', event => {
event.waitUntil(self.skipWaiting());
});
self.addEventListener('activate', event => {
event.waitUntil(self.clients.claim());
});
self.addEventListener('fetch', event => {
console.log(event.request); event.respondWith(fetch(event.request));
@FesterCluck
FesterCluck / gist:022a229615a4a348c361
Created December 13, 2014 01:40
Local Web Server + Proxy Relay
var sys = require("sys"),
http = require('http'),
path = require("path"),
url = require("url"),
filesys = require("fs");
http.createServer(function(request, response) {
var my_path = url.parse(request.url).pathname;
var full_path = path.join(process.cwd(),my_path);

Keybase proof

I hereby claim:

  • I am festercluck on github.
  • I am festercluck (https://keybase.io/festercluck) on keybase.
  • I have a public key whose fingerprint is 2951 3E9C A7B8 21A0 0538 A40C DCC7 C2A0 149B 4335

To claim this, I am signing this object:

@FesterCluck
FesterCluck / jQuery Tabbable Optimize
Last active August 29, 2015 14:09
Looking to optimize disableTabbing, enableTabbing, and jQuery.expr.filters.hidden
/*!
* jQuery.tabbable 1.0 - Simple utility for selecting the next / previous ':tabbable' element.
* https://github.com/marklagendijk/jQuery.tabbable
*
* Includes ':tabbable' and ':focusable' selectors from jQuery UI Core
*
* Copyright 2013, Mark Lagendijk
* Released under the MIT license
*
*/
@FesterCluck
FesterCluck / gist:10017298
Created April 7, 2014 09:33
Angular.extend
function extend(dst) {
var h = dst.$$hashKey;
forEach(arguments, function(obj){
if (obj !== dst) {
forEach(obj, function(value, key){
dst[key] = value;
});
}
});
@FesterCluck
FesterCluck / gist:8491391
Last active January 3, 2016 16:49
Rendered markup when testing https://github.com/angular-ui/ui-router/issues/782 , see screenshot of the render: http://pbrd.co/1h0fJ9r
<div id="ui-view" class="container" ui-view>
<h1 class="ng-scope ng-binding">Home! {{$id}}</h1>
<div ui-view="status" class="ng-scope">
<h1 class="ng-scope">Status Template</h1>
</div>
<div ui-view="content" class="ng-scope">
<h1 class="ng-scope">Content Template</h1>
</div>
<h4 class="ng-scope">Inside the {{title}} Controller!</h4>
</div>