Skip to content

Instantly share code, notes, and snippets.

View Zalart's full-sized avatar
🏆
prizerunning

Zalart

🏆
prizerunning
View GitHub Profile
@Zalart
Zalart / app.js
Created May 2, 2021 21:02
Get localhost:3000/api/movies
// Setup the environement variables form a .env file
require('dotenv').config();
// DB-config import
const connection = require('./db-config');
// Import express
const express = require('express');
//index.js
require('dotenv').config();
console.log(`I am ${process.env.MY_NAME} from ${process.env.MY_CITY} and I love ${process.env.MY_LANGUAGE}`);
//.env.sample
MY_NAME=YourName
MY_CITY=YourCity
MY_LANGUAGE=LanguageName
//.gitignore
@Zalart
Zalart / human-person.js
Created February 5, 2021 20:39
OOP in JS 1 - Procedural vs Object, classes and instances
class Person {
constructor(name, age) {
this.name = name;
this.age = age;
}
tellMyName() {
return `I am ${this.name}.`
}
tellMyAge() {
return `I'm ${this.age} years old.`
@Zalart
Zalart / history.txt
Created December 9, 2020 16:31
Linux - Terminal 3 - I/O and redirections
309 curl https://gist.githubusercontent.com/bhubr/bc3a21a0202109beeb31c4a677e0461b/raw/d8805eb82e8aabffab3b0163596c734f376617d0/wilders.csv -o wilders.csv
310 head wilders.csv
311 grep "France,2019,PHP" < wilders.csv | wc -l > php_france_2019.csv
312 grep JavaScript wilders.csv | grep 'Toulouse\|Biarritz' | cat javascript_biarritz_toulouse.csv
313 grep JavaScript wilders.csv | grep 'Toulouse\|Biarritz' | cat > javascript_biarritz_toulouse.csv
314 cat javascript_biarritz_toulouse.csv
315 history | tail -26 > history.txt
316 cat history.txt
317 history | tail -7 > history.txt
@Zalart
Zalart / gist:eedff65d0f7c2b4038cee5c3a4050d1d
Created December 9, 2020 15:45
Linux 2: Files and Directories
237 cd workshop/quests/shell
238 ls -a
242 curl -L -o planets.zip https://github.com/WildCodeSchool/quests-resources/blob/master/terminal/planets.zip\?raw\=true\nunzip planets.zip
243 mkdir planets/real planets/fictional planets/inhabited
244 mkdir planets/real/terrestrial planets/real/gas-giants planets/real/dwarf-planets
245 mv planets/mercury.jpeg planets/earth.jpeg planets/venus.jpeg planets/mars.jpeg planets/real/terrestrial
246 cd planets
247 ls -a
248 mv jupiter.jpeg saturn.jpeg planets/real/gas-giants
249 mv jupiter.jpeg saturn.jpeg real/gas-giants
@Zalart
Zalart / gist:6bfec705047a22d49e92cc6e1fe4cbec
Created December 8, 2020 16:02
Linux Terminal - starting point
➜ ~ clear
1 cd Загрузки/clmystery-master && ls -a
2 cat instructions
3 cat hint1
4 cat hint2
5 cd mystery
6 grep "Annabel" people
7 cd streets && ls
8 head -40 Hart_Place
9 head -173 Mattapan_Street
10 head -179 Buckingham_Place