Skip to content

Instantly share code, notes, and snippets.

@LeonFedotov
Created February 26, 2012 18:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LeonFedotov/1918181 to your computer and use it in GitHub Desktop.
Save LeonFedotov/1918181 to your computer and use it in GitHub Desktop.
My thing for tlvjs, for lulz use only.
/**
This is the code from a presentation given in the II JS meetup TLV,
for lulz use only. - http://www.meetup.com/telavivjs/events/50068512/
comments: twitter.com/leonFedotov
________
< o HAI! >
--------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
_____________
< ECMAScript! >
-------------
\ / \ //\
\ |\___/| / \// \\
/0 0 \__ / // | \ \
/ / \/_/ // | \ \
@_^_@'/ \/_ // | \ \
//_^_/ \/_ // | \ \
( //) | \/// | \ \
( / /) _|_ / ) // | \ _\
( // /) '/,_ _ _/ ( ; -. | _ _\.-~ .-~~~^-.
(( / / )) ,-{ _ `-.|.-~-. .~ `.
(( // / )) '/\ / ~-. _ .-~ .-~^-. \
(( /// )) `. { } / \ \
(( / )) .----~-.\ \-' .~ \ `. \^-.
///.----..> \ _ -~ `. ^-` ^-_
///-._ _ _ _ _ _ _}^ - - - - ~ ~-- ,.-~
/.-~
**/
var people = [
{ name: 'bob' },
{ name: 'roger' , isNotDone: true},
{ name: 'david' },
{ name: 'yisashar', isNotDone: true}
],
person;
/* this is bad
for(var person in people) {
if(people[person].isNotDone) {
people[person].isNotDone = false;
} else {
console.log(people[person].name, 'is out.');
delete people[person];
//people.splice(person, 1);
}
} */
/* this is pretty gewd! ^_^*/
while(person = people.pop()) {
if(person.isNotDone) {
person.isNotDone = !1;
people.unshift(person);
if(person.name == 'bob') {
debugger;
}
} else {
console.log(person.name, 'is out.');
}
}
//thats long
['d', 'c', 'z', 'a', 'f'].sort(function(a,b) {
return a.localeCompare(b);
});
//that is short
['d', 'c', 'z', 'a', 'f'].sort(function(){}.call.bind(''.localeCompare));
// ^ ^
//new is bad, Meew is a cat (*_*)
var meew = function(ob, params) {
var newOb = Object.create(ob);
return newOb.init.apply(newOb, params) || newOb;
};
///troll yo co worker. :)
window['⚛'] = console.log;
console.log = function() { window['⚛'].bind(this, 'lol you MAD?').apply({}, arguments);}
@LeonFedotov
Copy link
Author

also this works : console.log.bind(console, 'lol u MAD' );

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment