Skip to content

Instantly share code, notes, and snippets.

View keybase.md

Keybase proof

I hereby claim:

  • I am darrenscerri on github.
  • I am scerri (https://keybase.io/scerri) on keybase.
  • I have a public key ASDFua2xlKhmQJjOVehtM2iChreaf94ztOGbLASWMLt7gAo

To claim this, I am signing this object:

@darrenscerri
darrenscerri / Middleware.js
Last active Jun 20, 2021
A very minimal Javascript (ES5 & ES6) Middleware Pattern Implementation
View Middleware.js
var Middleware = function() {};
Middleware.prototype.use = function(fn) {
var self = this;
this.go = (function(stack) {
return function(next) {
stack.call(self, function() {
fn.call(self, next.bind(self));
});
@darrenscerri
darrenscerri / cursor.js
Created Feb 15, 2014
Bookmarklet to add an element to the page which displays cursor coordinates
View cursor.js
javascript:(function() {
var div = document.createElement('div');
div.style.cssText = 'position:fixed;bottom:10px;right:10px;padding: 4px 8px;border: 1px solid black;z-index:99';
document.body.appendChild(div);
document.onmousemove = function(e) {
div.innerHTML = e.clientX + ' : ' + e.clientY;
};
})();