Skip to content

Instantly share code, notes, and snippets.

View krokrob's full-sized avatar
🥞
Data Warehousing

Kevin ROBERT krokrob

🥞
Data Warehousing
View GitHub Profile
# puts "Hi John"
# puts "Hello Paul!"
# puts "Hello Ringo!"
require 'date'
def say_hi(name)
return "Hello #{name}!!"
end
first_name = "John"
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}"
# 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
# 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
// 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">
<!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">
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) => {
<!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">
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Playground - JavaScript 101</title>
<style>
ul {
list-style: none;
}
</style>
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>