This file contains hidden or 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
#!/usr/bin/env bash | |
set -Eeuo pipefail | |
trap cleanup SIGINT SIGTERM ERR EXIT | |
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P) | |
usage() { | |
cat << EOF # remove the space between << and EOF, this is due to web plugin issue | |
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...] |
This file contains hidden or 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
// GET CARS | |
// DONE - define the url to make the requests to | |
// DONE - use fetch to send a request to the url | |
// DONE - for each element response of the fecth insert the html into the page | |
// DONE - loop through the cars | |
// DONE - inside the loop store the data of the cars into well named variables | |
// DONE - query selector to select the car list element | |
// DONE - create the html string | |
// DONE - insert into the page |
This file contains hidden or 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 baseUrl = "https://person.clearbit.com/v2/people/find?email="; | |
const authorization = "Bearer sk_d32a1fafc46187184db79ee19e470a5f"; | |
// DONE - Add an Event listener to the submit button | |
// DONE - Get the value of the input | |
// DONE - Call the clearbit api | |
// DONE - Process the response | |
// Update the html with the response data | |
// <tr> |
This file contains hidden or 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 searchPlaces = (inputValue) => { | |
const url = "https://places-dsn.algolia.net/1/places/query"; | |
fetch(url, { | |
method: "POST", | |
body: JSON.stringify({ query: inputValue }), | |
}) | |
.then(response => response.json()) | |
.then((result) => { |
This file contains hidden or 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 start = () => { | |
// 1. DONE - Event listener on click | |
// select td elements | |
// 3. DONE - Add class "empty" to clicked element | |
// 2. DONE - Find the previously empty element (class="empty") | |
// 4. DONE - Add the number from the clicked element to | |
// the previously empty element | |
// 5. DONE - Remove the number from the cicked element. | |
// 6. DONE - Remove the class "empty" from the previously | |
// empty element |
This file contains hidden or 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
import shortid from 'shortid'; | |
import _ from 'lodash'; | |
function getRedisClient() { | |
// IMPLEMENT YOUR OWN METHOD OF GETTING THE REDIS CLIENT, | |
} | |
function expSeconds(days = 30) { | |
const secondsPerDay = 86400; | |
return days * secondsPerDay; |
This file contains hidden or 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
require 'byebug' | |
require_relative 'patient' | |
require_relative 'room' | |
harry = Patient.new(name: 'Harry Potter', age: 28) | |
ron = Patient.new(name: 'Ron Weasley', age: 28) | |
hermione = Patient.new(name: 'Hermione Granger', age: 28) | |
draco = Patient.new(name: 'Draco Malfoy', age: 28) | |
hogwarts_room = Room.new(capacity: 3, decorative_theme: 'Hogwarts') |
This file contains hidden or 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 a welcome message | |
puts 'WELCOME TO THE SUPERSTORE!' | |
# Define a sum of 0 euro | |
sum = 0 | |
# Define a hash (of shopping items) | |
# with keys as STRINGS and values as floats | |
items = { |
This file contains hidden or 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 a welcome message | |
puts 'WELCOME TO THE SUPERSTORE!' | |
# Define a sum of 0 euro | |
sum = 0 | |
# Define a hash (of shopping items) | |
# with keys as STRINGS and values as floats | |
items = { |
This file contains hidden or 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
class Food | |
attr_accessor :people_who_like_me | |
def initialize(attr = {}) | |
@name = attr[:name] | |
@finger_food = true | |
@people_who_like_me = [] | |
end | |
def name |
NewerOlder