This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
JavaScript Trabb Pardo-Knuth function | |
by Evan Hahn (evanhahn.com) | |
licensing info at bottom of file | |
This doesn't ask for input because you might want to use it in the browser or | |
in Node or something. | |
Call like this: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### | |
CoffeeScript Caesar shift | |
by Evan Hahn (evanhahn.com) | |
* * * * * * * * * * * * | |
For small occasions (like month-anniversaries), I like to make little websites | |
for people that only "unlock" on the right day. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install something if we don't already have it | |
# Call like this: | |
# gimme git | |
# gimme hg pip | |
# gimme coffee npm (note that npm installs globally) | |
# This isn't particularly thorough (i.e., it assumes Ubuntu even if it's Debian). | |
# Sorry! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Wikipedia restyling | |
by Evan Hahn (evanhahn.com) | |
Made for Stylebot. | |
********************************************************************** | |
This is free and unencumbered software released into the public domain. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Typechecking Jasmine matchers | |
by Evan Hahn (evanhahn.com) | |
Simple Jasmine matchers for checking types. Include this file to get the | |
following matchers: | |
expect(foo).toBeA(Thing); // Checks if foo is an instance of Thing. | |
// Alias: toBeAn(AwesomeThing) | |
expect(foo).toBeANumber(); | |
expect(foo).toBeAnInteger(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Make console methods no-ops in unsupported browsers, complete | |
// More versions: <http://evanhahn.com/?p=990> | |
var noop = function(){}; | |
window.console || (window.console = {}); | |
window.console.assert || (window.console.assert = noop); | |
window.console.clear || (window.console.clear = noop); | |
window.console.count || (window.console.count = noop); | |
window.console.debug || (window.console.debug = noop); | |
window.console.dir || (window.console.dir = noop); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Make console methods no-ops in unsupported browsers, terse | |
// More versions: <http://evanhahn.com/?p=990> | |
var noop = function(){}; | |
window.console || (window.console = {}); | |
window.console.error || (window.console.error = noop); | |
window.console.info || (window.console.info = noop); | |
window.console.log || (window.console.log = noop); | |
window.console.warn || (window.console.warn = noop); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Make console methods no-ops in unsupported browsers, complete | |
# More versions: <http://evanhahn.com/?p=990> | |
noop = -> | |
window.console || (window.console = {}) | |
window.console.assert || (window.console.assert = noop) | |
window.console.clear || (window.console.clear = noop) | |
window.console.count || (window.console.count = noop) | |
window.console.debug || (window.console.debug = noop) | |
window.console.dir || (window.console.dir = noop) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Make console methods no-ops in unsupported browsers, terse | |
# More versions: <http://evanhahn.com/?p=990> | |
noop = -> | |
window.console || (window.console = {}) | |
window.console.error || (window.console.error = noop) | |
window.console.info || (window.console.info = noop) | |
window.console.log || (window.console.log = noop) | |
window.console.warn || (window.console.warn = noop) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var tagsStripped = str.replace(/<[^>]*>/g, ''); |