Skip to content

Instantly share code, notes, and snippets.

View eliperelman's full-sized avatar

Eli Perelman eliperelman

View GitHub Profile
@eliperelman
eliperelman / LICENSE.txt
Created June 20, 2011 20:39 — forked from 140bytes/LICENSE.txt
String trim methods polyfill for 140byt.es
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Eli Perelman <http://eliperelman.com>
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
@eliperelman
eliperelman / LICENSE.txt
Created June 21, 2011 03:50 — forked from 140bytes/LICENSE.txt
Array.prototype.every polyfill for 140byt.es
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Eli Perelman <http://eliperelman.com>
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
@eliperelman
eliperelman / HttpError.js
Created January 5, 2012 16:57 — forked from unscriptable/HttpError.js
Example "subclass" of Error object
define(function () {
var HttpError = function (msg, code) {
var ex = new Error(msg || 'Unknown HTTP error');
ex.code = code;
ex.toString = function() {
return 'Error: '
+ (this.code ? '' : '(' + this.code + ') ')
+ this.message;
};
@eliperelman
eliperelman / index.html
Created January 18, 2012 22:04 — forked from JeffreyWay/legacy.js
Legacy JS
<!doctype html>
<html>
<head></head>
<body>
<ul>
<li><a href="#">1</a></li>
<li><a href="#">2</a></li>
<li><a href="#">3</a></li>
</ul>
@eliperelman
eliperelman / lazy_parse_int.js
Created February 3, 2012 16:58 — forked from nathansmith/parseint.js
Makes parseInt have default radix of 10.
// JSLint:
/*global window, parseInt*/
// Conditionally check value, in case
// future implementations of parseInt
// provide native base-10 by default.
(function () {
var _parseInt = window.parseInt;
if (_parseInt('09') === 0) {
person.eat(food, function() {
if (typeof food === 'tacobell') {
// Kinda yum...
setInterval(function() {
// Oh noes!
// http://www.hulu.com/watch/10304/saturday-night-live-colon-blow
colon.blow();
}, 120000); // 2 hrs.
}
});
function deferredRequest( resource, data ) {
return $.Deferred(function( dfd ) {
amplify.request({
resourceId: resource,
data: data,
success: dfd.resolve,
error: dfd.reject
});
}).promise();
}
JSWEEKLY BINGO
+-------------------------------+-------------------------------+-------------------------------+
| An article from someone who | | |
| just figured out | Baby's first functional | How to do this one very |
| prototype-based OO and thinks | programming | specific thing in Node.js |
| everyone else needs telling | | |
+-------------------------------+-------------------------------+-------------------------------+
| | | |
| A new jQuery release | A job in San Francisco | An introduction to an MVC |
| | | framework |
Command to run:
ssh -L 2222:localhost:8501 user@remoteserver.com
where 2222 is the local port mapping it can be any number above 1000
where localhost must be set to localhost and refers to your current connection
where 8501 is the port you will be opening up on the remote machine
where user@remoteserver.com is the first hop in your quest for internal access
lib-cov
*.seed
*.log
*.csv
*.dat
*.out
*.pid
*.gz
pids