Skip to content

Instantly share code, notes, and snippets.

Alexander Prinzhorn Prinzhorn

Block or report user

Report or block Prinzhorn

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View README.md

This is an excerpt from a 465 lines js file. This is not satirical. This is actual code from a large codebase (>100k js) of an application that is used in production at multiple customers.

If you're giving a talk or lecture about code quality, feel free to use this as the first slide to make your audience giggle for a second. And then look at their faces when you tell them it's actual code.

@Prinzhorn
Prinzhorn / index.js
Created Aug 13, 2014
Functions for checking if an int is equal to another int. So intuitive!
View index.js
for(var i = 0; i < 4294967296; i++) {
global['is' + i] = (function(i) {
return function(n) {
return !(i - n);
};
}(i));
}
console.log(is5(5));//true
console.log(is5(9));//false
View README.md
@Prinzhorn
Prinzhorn / README.md
Last active Aug 29, 2015
Open the GitHub repository for the current GitHub page
View README.md

There are so many projects hosted on GitHub pages which do not have a prominent link to the repo on the page. I always (╯°□°)╯︵ ┻━┻ when this happens because I have to manually enter the stupid URL.

Here's a Bookmarklet

javascript:!function(){var o=location.href.match(/(\w+).github.io\/(\w+)/);o&&(window.location="https://github.com/"+o[1]+"/"+o[2])}()
@Prinzhorn
Prinzhorn / rethinkdb-express.js
Last active Aug 29, 2015
RethinkDB with Express
View rethinkdb-express.js
var express = require('express');
var r = require('rethinkdb');
var app = express();
r.connect(config.rethinkdb, function(err, conn) {
if(err) {
return handleError(res, err);
}
@Prinzhorn
Prinzhorn / LICENSE.txt
Created Oct 3, 2011 — forked from 140bytes/LICENSE.txt
American Soundex
View LICENSE.txt
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@Prinzhorn
Prinzhorn / LICENSE.txt
Created Oct 3, 2011 — forked from 140bytes/LICENSE.txt
Fibonacci with dynamic programming
View LICENSE.txt
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
View LICENSE.txt
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
View LICENSE.txt
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Alexander Prinzhorn
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
View dabblet.css
#box {
width:985px;
height:140px;
background:url(http://style.tutorials.de/v10/small-liveworkshops.jpg) repeat-y 0px 0px;
-moz-animation-duration: 5s;
-moz-animation-name: ticker;
-moz-animation-iteration-count:infinite;
-moz-animation-timing-function:linear;
}
@-moz-keyframes ticker {
You can’t perform that action at this time.