Skip to content

Instantly share code, notes, and snippets.

View sandrabosk's full-sized avatar
👩‍💻
Always a student, never a master. Have to keep moving forward. ~C.Hall

Aleksandra Bošković sandrabosk

👩‍💻
Always a student, never a master. Have to keep moving forward. ~C.Hall
  • Ironhack
View GitHub Profile

[WIN] Install nvm

nvm is a terminal command that allows you to install and switch between different versions of Node.js. Usually, your system can have only one version of Node.js installed at one time. With nvm, you can switch to a newer version, try some new features, and then back to an older version for your more serious projects.

  1. Check if nvm and was installed:
$ nvm --version
# 0.32.1 (current, but in the time you check might be different)

[MAC] Install Node.js

  • Visit the Node.js website.
  • Check the version number of the LTS version of Node.js.
  • Run this command in your terminal (replace 12.16.0 with the latest version number):
$ nvm install 12.16.0

[MAC] Install nvm

Remember the Homebrew? In case you missed to install this earlier, please refer to the lesson Mandatory Mac Installations for the prework. We will be using brew command to install the nvm.

nvm is a terminal command that allows you to install and change between different versions of Node.js. Usually, your system can have only one version of Node.js installed at one time. With nvm, you can switch to a newer version, try some new features, and then back to an older version for your more serious projects.

  • Run these commands one by one in your terminal:
$ mkdir ~/.nvm

[MAC] Install the Xcode Command Line Tools

Xcode is Apple's development bundle and can be installed by running the following command in terminal (don't type the $ sign):

$ xcode-select --install
  • Follow the installations step in the pop-up window.
  • Once Xcode is installed, start it up. The tools we need will not work unless the app has run once, and you’ve accepted the license agreement. You don’t need to do anything with the app. Just start it up (it might take a while to run the first time, even on a fast machine), click agree, and then you can exit from it.
// 1. What is HTTP?
// ... your answer
// 2. What is a URL?
// ... your answer
// 3. What is IP?
// ... your answer

1. What is HTTP?

Hyper Text Transfer Protocol is set of rules that have to be respected to be able to transfer data on the Internet. It sets the rules how clients get data from servers and how clients can send data to servers.

2. What is a URL?

URL stands for Uniform Resource Locator and it is a fundamental network identification for any resource connected to the web.

3. What is IP?

Client and server communication

Clients and servers exchange messages in a request-response messaging pattern:

  1. The client sends a request
  2. The server returns a response

function eligibleToDrink (age) {
return new Promise((resolve, reject) => {
if(age >= 18) {
resolve(`Being ${age} years old, you are eligible to drink.`);
} else {
reject(`${age} years is underage. Here is a fresh squeezed orange juice for you!`);
}
})
}
// Write a function eligibleToDrink() that takes a number as an argument and returns a promise
// that tests if the passed value is less than or greater than the value 18.
// If greater then 18, resolve with 'Being ___ years old, you are eligible to drink'.
// If less then 18, reject with '___ years is underage. Here is a fresh squeezed orange juice for you!'
function eligibleToDrink (age) {
// ... your code