Skip to content

Instantly share code, notes, and snippets.

View josecarneiro's full-sized avatar

José Carneiro josecarneiro

View GitHub Profile
@josecarneiro
josecarneiro / webinar-resources.md
Last active February 22, 2022 01:19
Resources for "The Basics of Web Development" webinar
// Iteration 1: All directors? - Get the array of all directors.
// _Bonus_: It seems some of the directors had directed multiple movies so they will pop up multiple times in the array of directors.
// How could you "clean" a bit this array and make it unified (without duplicates)?
function getAllDirectors(movies) {
return movies.map((movie) => {
return movie.director;
});
}
// Iteration #1: Find the maximum
function maxOfTwoNumbers(a, b) {
// if (a > b) {
// return a;
// } else if (b > a) {
// return b;
// } else {
// return a;
// }
// if (a > b) {
@josecarneiro
josecarneiro / index.html
Created January 22, 2022 11:50
ironhack-jan-2022-lab-recipes-solution
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Apple Pie Recipe</title>
<link rel="stylesheet" href="styles/style.css" />
</head>
<body>
<header>
@josecarneiro
josecarneiro / MATERIALS.md
Last active November 9, 2022 18:00 — forked from ross-u/README.md
webinar-portfolio-html-css-resources
// ITERATION 1
function updateSubtotal(productElement) {
const productPriceElement = productElement.querySelector('.price span');
const productQuantityInputElement =
productElement.querySelector('.quantity input');
const priceValue = Number(productPriceElement.innerText);
const quantityValue = productQuantityInputElement.valueAsNumber;
// Iteration 1: All directors? - Get the array of all directors.
// _Bonus_: It seems some of the directors had directed multiple movies so they will pop up multiple times in the array of directors.
// How could you "clean" a bit this array and make it unified (without duplicates)?
function getAllDirectors(movies) {
// const directors = [];
// for (const movie of movies) {
// directors.push(movie.director);
// }
// const directors = movies.map((movie) => {
// return movie.director;
// Iteration #1: Find the maximum
function maxOfTwoNumbers(a, b) {
// if (a > b) {
// return a;
// } else if (b > a) {
// return b;
// } else {
// return a;
// }
// if (a > b) {
@josecarneiro
josecarneiro / index.html
Created June 10, 2021 18:17
ironhack-6-2021-recipes-lab-solution
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Apple Pie Recipe</title>
<!-- don't forget to link your styles -->
<link rel="preconnect" href="https://fonts.gstatic.com" />
<link
href="https://fonts.googleapis.com/css2?family=Lato:wght@300;400&display=swap"
// Write your Pizza Builder JavaScript in this file.
// Constants
let basePrice = 10;
let ingredients = {
pepperoni: { name: 'pepperoni', price: 1 },
mushrooms: { name: 'Mushrooms', price: 1 },
greenPeppers: { name: 'Green Peppers', price: 1 },
whiteSauce: { name: 'White sauce', price: 3 },
glutenFreeCrust: { name: 'Gluten-free crust', price: 5 }