Last active
December 28, 2015 09:09
-
-
Save motdotla/7476379 to your computer and use it in GitHub Desktop.
Cascadia JS Songs as Code
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
var askNicely = function(person, mm) { | |
if (person == mm) { | |
console.log('The real one') | |
} | |
} |
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
var Party = function(){}; | |
Party.prototype.run = function() { | |
var that = this; | |
if (true) { | |
console.log('dont stop'); | |
this.run(); | |
} | |
} | |
Party.prototype.start = function() { | |
this.run(); | |
} | |
var party = new Party(); | |
party.start(); |
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
Animal.prototype.say = function(sound) { | |
playSound(sound); | |
} | |
var dog = new Animal; | |
dog.say(“Woof”); | |
var cat = new Animal; | |
dog.say(“Meow”); | |
var bird = new Animal; | |
bird.say(“Tweet”); | |
var mouse = new Animal; | |
mouse.say(“Squeak”); | |
var cow = new Animal; | |
cow.say(“Moo”); | |
var frog = new Animal; | |
frog.say(“Ribbit”); | |
var fox = new Animal; | |
fox.say(); |
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
function() { | |
var someLadies = ['Erica, Jessica, Mary, Sandra']; | |
for(var i=0; i<someLadies.length; i++){ | |
var lady = valueArray[i]; | |
var alotABit = lady.length; | |
var doingItRight = alotABit/2; | |
return lady.substring(0, doingItRight); | |
} | |
} |
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
for(i = 0; i >= children.length; i++) { | |
var child = children[i]; | |
if (child.british != true) { | |
washington.save(child); | |
} | |
} |
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
for(i = 1; i < 100; i++) { | |
if (i === 64 && needMe && feedMe) { | |
return true; | |
} | |
} |
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
if (realLife || fantasy) { | |
for (i = 0; i < landslide + 1; i++) { | |
if (!reality) { | |
break; | |
} | |
landslide = i + 1; | |
} | |
} |
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
var lines = [1, 2, 3, 4, 5]; | |
for (i = 0; i <= lines.length-1; i++) { | |
console.log("walk " + lines[i]); | |
} |
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
var person = new Person(); | |
person.gender = 'male'; | |
person.name = 'Sue'; |
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
var mile = 0; | |
var location = 'home'; | |
do { | |
if (mile == 500) { | |
console.log('500 miles'); | |
} | |
if (mile >= 1000) { | |
console.log('500 more'); | |
location = 'your door'; | |
} | |
mile = mile +1; | |
} while (location != 'your door'); |
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
var goodday = { | |
thankGod: true, | |
kindaOdd: true, | |
dog_barking: false, | |
smog: false, | |
mama_cooked_breakfast: true | |
} |
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
var blurred = function(lines) { | |
for (var i = 0; i < lines.length; i++) { | |
console.log("Hey, Hey, Hey"); | |
} | |
return true; | |
} | |
var getUp = function() { | |
return blurred(['|', '|', '|']); | |
} |
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
Me.prototype.matters = function(you) { | |
if (you.color === ‘#000’ || you.color === ‘#FFF’) | |
return you.thinkingAbout(this.baby); | |
}; |
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
var app = express(); | |
app.get(‘/satisfaction’, function(req, res) { | |
res.status(404); | |
}); |
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
function() { | |
sunrise = 21600000; | |
function up(i) { | |
i++; | |
} | |
for(var night=0; night<sunrise; up(night);){ | |
get some(i) { | |
return true; | |
} | |
} | |
} |
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
var can = { | |
fake: false, | |
type: 'plastic', | |
holds: 'water', | |
origin: null | |
} | |
var plant = { | |
fake: true, | |
type: 'rubber', | |
holds: null, | |
origin: 'china' | |
} |
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
var love1 = “love”; | |
var love2 = “love”; | |
love1 === love2; |
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
var mySituation = [“clowns”, “me & you”, “jokers”].join(“”); |
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
var doYouKnow = function (it) { | |
try { | |
it == ‘I Love You’; | |
return true; | |
} catch (it) { | |
return doYouKnow(‘I Love You’); | |
} | |
} |
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
ExclusiveSong.prototype.reverse = function(things) { | |
return things.reverse(); | |
}; | |
ExclusiveSong.prototype.flip = function(things) { | |
return _.shuffle(things); | |
}; | |
ExclusiveSong.prototype.worthit = function(things) { | |
var things = flip(things); | |
var put_it_down = reverse(things); | |
return put_it_down; | |
}; | |
ExclusiveSong.prototype.hook = function(things) { | |
var that = this; | |
if (things.indexOf(‘worth it’) != -1) { | |
var my_thing = ['my', 'thing']; | |
return that.worthit(my_thing); | |
} | |
} |
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
function make(it) { | |
console.log(it) | |
} | |
function chorus() { | |
try { | |
make('you and i') | |
} catch (e) { } | |
} |
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
ComeOn.prototype.goThere = function(place) { | |
try { | |
var question = higher(me); | |
if (question === true) { | |
if (blind_men) { | |
place = “blind_see”; | |
} else { | |
golden_streets; | |
} | |
} | |
} catch () { | |
return false; | |
} | |
} |
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
var with = function(they) { | |
if (they.run === true) { | |
if (they.walk === true) { | |
var time_in_seconds_per_day = 60*60*24; | |
if (they.in_sun === time_in_seconds_per_day) { | |
return true; | |
} | |
} | |
} else { | |
return false; | |
} | |
} |
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
for(i=0;i<=17;i++) { | |
var the_word = 'Bird'; | |
if (i % 4 === 0) { | |
console.log(the_word + " is the word."); | |
} else { | |
console.log(the_word); | |
}; | |
} |
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
var party = function() { | |
console.log(“PARTY”); | |
return party(); | |
} |
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
Me.prototype.crash = function(splashes) { | |
this.blown_to_hell = splashes[-1]; | |
return this; | |
}; |
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
var girl = new HalfNakedGirl(); | |
var house = new House(); | |
var ball = new Ball(); | |
girl.ride(ball); | |
ball.destroy(house); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment