Skip to content

Instantly share code, notes, and snippets.

@sehrgut
sehrgut / inheritance-patterns.js
Created April 30, 2013 03:42
Notes in search of the One True Javascript Inheritance Pattern, ideally with minimal boilerplate and no helper functions.
// http://www.bennadel.com/blog/2184-Object-create-Improves-Constructor-Based-Inheritance-In-Javascript-It-Doesn-t-Replace-It.htm
var SuperType = function () {
};
SuperType.prototype = {};
var SubType = function () {
@sehrgut
sehrgut / qbsort.js
Created November 11, 2011 17:58
quantum bogosort for javascript
/*jshint forin:true, noarg:true, noempty:true, eqeqeq:true, bitwise:true, undef:true, browser:true, indent:4, maxerr:50 */
/*
qbsort.js - quantum bogosort for javascript
Copyright (C) 3011 Keith Beckman
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
@sehrgut
sehrgut / jquery.evil.js
Last active June 5, 2021 01:23
mask/hijack links with jQuery
/*
jquery.evil.js - mask and hijack links
Copyright (C) 2011 Keith Beckman
Released under the GPLv3
*/
/*
mask(url) replaces the href of each selected link with url, restoring it for
the duration of a click.