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
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 |
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
brew install nvm
restart terminal
nvm install 14.15
nvm alias default 14.15
restart terminal
// 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'; | |
}); |
// 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`) |
Turbolinks is a JavaScript library that intercepts all clicks on <a>
links and makes that request via AJAX.
It then merges the <head>
and replaces the current page <body>
with the new body from the AJAX HTML response.
The promise:
Here is a list of guidelines you should follow during a part-time session:
This is the best way to kickstart the session and have everyone concerned and motivated.
Students should know they can report any problem to you.
require_relative "../citizen" | |
describe Citizen do | |
describe "can vote" do | |
it "should return true for a major citizen" do | |
citizen = Citizen.new("", "", 25) | |
expect(citizen.can_vote?).to eq(true) | |
end | |
it "should return false for a minor citizen" do |
class Car # => UpperCamelCase | |
# attr_reader :color, :brand | |
# attr_writer :color | |
attr_accessor :color, :brand | |
def initialize(color, brand) # => constructor stores the data/state | |
@color = color | |
@brand = brand | |
@engine_started = false # => instance variable | |
end |