Skip to content

Instantly share code, notes, and snippets.

View juliends's full-sized avatar

Julien Da Silva juliends

View GitHub Profile
@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
@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 / 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

// 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`)
@juliends
juliends / turbolinks.md
Created February 19, 2020 13:16
Turbolinks notes

🎄 Garden and Plants 🎄

This is an optional exercice for the batch 301 during christmas holidays 🎅


Preparation

You need to go into your code/$USERNAME directory in which you will create your rails app.

Lead TA on Le Wagon part-time

Here is a list of guidelines you should follow during a part-time session:

1) Introduce the staff of the day for each session

This is the best way to kickstart the session and have everyone concerned and motivated.

2) You are the referrer for students

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