Skip to content

Instantly share code, notes, and snippets.

View juliends's full-sized avatar

Julien Da Silva juliends

View GitHub Profile
// Select the form
const form = document.querySelector('#search-movies');
// Listen to the submit event
form.addEventListener('submit', (event) => {
// Prevent the default reload behavior of the form
event.preventDefault();
// Retrieve the searched keyword
const keyword = document.querySelector('#keyword').value;
// Call the API with the keyword
fetch(`http://www.omdbapi.com/?s=${keyword}&apikey=adf1f2d7`)
// Select the button
// const button = document.getElementById('btn');
const button = document.querySelector('#btn');
// Listen to click event
button.addEventListener('click', (event) => {
// Update the btn text - Callback
event.currentTarget.innerText = 'Please wait';
});
@juliends
juliends / nvm_osx.md
Last active November 9, 2020 19:17
Install of NVM (Node version manager) for Mac users

brew install nvm

restart terminal

nvm install 14.15

nvm alias default 14.15

restart terminal

@juliends
juliends / nvm_wsl.md
Last active November 9, 2020 19:25
Install of NVM (Node version manager) for Ubuntu users

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.0/install.sh | bash

restart terminal

nvm install 14.15

If NVM is not found see the last section of this gist

nvm alias default 14.15

@juliends
juliends / imdb.yml
Last active February 17, 2021 15:21
imdb
movies:
- title: "Superman"
year: 1978
director_slug: donner
synopsis: |
An alien orphan is sent from his dying planet to Earth,
where he grows up to become his adoptive home's first and greatest superhero.
- title: "Batman v Superman: Dawn of Justice"
year: 2016
director_slug: snyder