Created
February 26, 2012 18:31
-
-
Save LeonFedotov/1918181 to your computer and use it in GitHub Desktop.
My thing for tlvjs, for lulz use only.
This file contains 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
/** | |
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);} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
also this works : console.log.bind(console, 'lol u MAD' );