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
def prompt | |
print("> ") | |
end | |
puts("You enter a dark room with two doors. Do you go through door #1 or #2?") | |
prompt; door = gets.chomp | |
if door == "1" | |
puts("You walk towards door #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
def prompt | |
print("> ") | |
end | |
puts("You enter a dark room with two doors. Do you go through door #1 or #2?") | |
prompt; door = gets.chomp | |
if door == "1" | |
puts("You walk towards door #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
// Check if the player is ready to play! | |
confirm("Are you ready to begin?"); | |
// How old is the player? | |
var age = prompt("How old are you?"); | |
if (age < 18) { | |
console.log("Fine, you can play, but I'm not responsible for you."); | |
} else { | |
console.log("Let's go!"); |
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 userChoice = prompt("Do you choose rock, paper or scissors?"); | |
var computerChoice = Math.random(); | |
if (computerChoice < 0.34) { | |
computerChoice = "rock"; | |
} else if(computerChoice <= 0.67) { | |
computerChoice = "paper"; | |
} else { | |
computerChoice = "scissors"; | |
} |
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 user = prompt("An elderly lady approaches you, brandishing a sharpened umbrella. Do you FIGHT, do you RUN or do you CURL up into the fetal position?").toUpperCase(); | |
switch(user) { | |
case 'FIGHT': | |
console.log("You'd really hurt an old lady? For shame."); | |
var hits = prompt("How many times will you hit her?"); | |
var sure = prompt("Are you sure?").toUpperCase(); | |
if (hits >= 1 && sure === 'YES') { | |
console.log("How Heinous. She's dead. And you're a bad person."); | |
} else if (hits === 0 || sure === 'NO' ) { |
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
// First we need to identify where in the DOM we're applying the list. | |
var parent = document.getElementById('output'); | |
// Then we need to create the ordered list in the DOM. | |
var ol = document.createElement('ol'); | |
// We have an ordered list. But we need to make sure it's within the "output" element! | |
parent.appendChild(ol); | |
// Time for some more sexy FizzBuzz. | |
// This is FizzBuzzing from number 1 - 100. | |
for (var i = 1; i <= 100; 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
<form> | |
<input id="body" placeholder="Charlotte! You are Amazeballs!" /> | |
<button id="button">Text Me, Baby!</button> | |
</form> |
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
Functional programming is abstraction through the use of functions and reduce something into it's most basic components. FP involves keeping your functions as pure as possible and not mutating the state of the program at any point with them. | |
How does functional programming differ from OOP? What are higher order functions? How do you get started with functional JavaScript? Tim will answer all your questions and more, taking you through the core concepts and code examples of FP. |
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
// Include gulp | |
var gulp = require("gulp"); | |
// Include gulp plugins | |
var jshint = require("gulp-jshint"); | |
var sass = require("gulp-sass"); | |
// JS Lint Task | |
gulp.task("lint", function() { | |
return gulp.src("js/*.js") |
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
Front-End London - https://www.youtube.com/playlist?list=PLOSHQ_hfikSoJ2tOfCheuiPcEcbSa7WpO | |
XOXO Fest - https://www.youtube.com/user/xoxofest | |
Generate - http://www.generateconf.com/videos | |
Lots of stuff from the jQuery Cons - https://www.youtube.com/channel/UCDT2QjewZ8DHsiaDXQFkxPg | |
Lots of stuff from JS Confs & CSS Conf EU - https://www.youtube.com/user/jsconfeu | |
Sass Conf 2013 - https://www.youtube.com/playlist?list=PLXrTmSPkhnXsd_MGL5Y__7IoRemarkRVi |
OlderNewer