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
# puts "Hi John" | |
# puts "Hello Paul!" | |
# puts "Hello Ringo!" | |
require 'date' | |
def say_hi(name) | |
return "Hello #{name}!!" | |
end | |
first_name = "John" |
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
age = 17 # Affectation | |
puts "Lucky you! You are #{age}" | |
puts "Happy Birthday!" | |
# age = 18 # Re-affectation | |
# age = age + 1 | |
age += 1 # Incrementation | |
puts "Now you are #{age}" |
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
# It is a screenshot from IRB | |
[1] pry(main)> 1 + 1 | |
=> 2 | |
[2] pry(main)> -1 | |
=> -1 | |
[3] pry(main)> 1.even? | |
=> false | |
[4] pry(main)> 1.odd? | |
=> true | |
[5] pry(main)> 1984.class |
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
# It is a screenshot from IRB | |
[1] pry(main)> 'hello' | |
=> "hello" | |
[2] pry(main)> 'hello' == "hello" | |
=> true | |
[3] pry(main)> 'hello'.length | |
=> 5 | |
[4] pry(main)> 'hello'.upcase | |
=> "HELLO" | |
[5] pry(main)> '1984'.class |
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
// TODO: Build an awesome garage! | |
// GET ALL CARS | |
// call api with fetch | |
const carsList = document.querySelector(".cars-list"); | |
const baseUrl = 'https://wagon-garage-api.herokuapp.com'; | |
const garageName = 'awesome'; | |
const buildCar = (car) => { | |
return `<div class="car"> |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Le Wagon Garage</title> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"> | |
<link rel="stylesheet" href="stylesheets/style.css"> | |
</head> | |
<body> | |
<div class="app"> |
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
const authorization = "Bearer sk_199228b4fee4b7a01c82ddae0a27161d"; | |
// TODO | |
// | |
const displayResult = (id, value) => { | |
const target = document.querySelector(`#${id}`); | |
target.innerText = value; | |
} | |
// 1 - Communicate with API | |
const stalk = (email) => { |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>ClearBit Demo</title> | |
<link rel="stylesheet" href="style.css"> | |
</head> | |
<body> | |
<h1>ClearBit Demo</h1> | |
<form action="#" id="clearbitForm"> |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Playground - JavaScript 101</title> | |
<style> | |
ul { | |
list-style: none; | |
} | |
</style> |
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
const call = (search) => { | |
fetch(`http://omdbapi.com/?apikey=adf1f2d7&s=${search}`) | |
.then((response) => response.json()) | |
.then((data) => { | |
const list = document.querySelector('#movies'); | |
list.innerText = ''; | |
data.Search.forEach((movie) => { | |
console.log(movie); | |
const item = `<li> |