Skip to content

Instantly share code, notes, and snippets.

@AmauryLugdu
AmauryLugdu / javascript.json
Last active September 14, 2019 18:12
Creation de Snippets
{
"Simple Console Log": {
"prefix": "csl",
"body": "console.log($1);",
"description": "Simple Console Log"
},
"Array methods": {
"prefix": "arrmtd",
22 ls
23 cat people
24 grep "Lubomir Frank" people | grep "Pape Kantarci" | grep "Alberto Pedersen" | grep "Joe Germuska" | grep "Marharyta Willmott" | grep "Jeremy Bowers" | grep "Darae Charlos" | grep "Jacqui Maher" people
25 grep "Lubomir Frank" people | grep "Pape Kantarci" | grep "Alberto Pedersen" | grep "Joe Germuska" | grep "Marharyta Willmott" | grep "Jeremy Bowers" | grep "Darae Charlos" | grep "Jacqui Maher" people > suspect3
26 ls
27 cat suspect3
28 rm suspect3
29 ls
30 cat membership
31 cat memberships
@AmauryLugdu
AmauryLugdu / gist:8c5b7f8da0fed24cdbb7d779f705dfd2
Created September 20, 2019 07:38
Maitriser Unix en mode avancé
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/Users/emilybremond/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
@AmauryLugdu
AmauryLugdu / quete.ts
Created September 30, 2019 09:41
Quete WildCodeSchool typescript_1
function hello(name:string) {
console.log("Hello " + name);
}
var firstName:string = "bob";
hello(firstName);
hello(firstName + " marley");
function concat(a:string, b:string) {
@AmauryLugdu
AmauryLugdu / gist:89d518e3d9fab2a02034d3ddfabcc897
Created September 30, 2019 11:39
Quete WildCodeSchool Poo1_2
class Person{
name:string;
age:number;
constructor(name: string, age: number){
this.name = name;
this.age = age;
}
@AmauryLugdu
AmauryLugdu / app.js
Created October 4, 2019 11:21
decouverte de node.js
process.stdin.resume()
process.stdin.setEncoding('utf8')
console.log('How old are you ?')
process.stdin.on('data', (number) => {
if (isNaN(number)){
console.log ("type a number please")
}
else{
if(number<99 && number>0){
import * as assert from 'assert';
class BankCustomer{
private name:string;
private pinInput: string;
constructor(name:string, pinInput:string){
@AmauryLugdu
AmauryLugdu / helloboy.js
Created October 6, 2019 13:05
module node
var cowsay = require("cowsay");
console.log(cowsay.say({
text : "Hello boy",
e : "oO",
T : "U "
}));
// or cowsay.think()
@AmauryLugdu
AmauryLugdu / gist:e10847fa9e5b57861864772088fd1d0f
Created November 19, 2019 09:56
02 - Retrieving information with SELECT
mysql> USE wild_db_quest;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> SELECT firstname,lastname,birthday,birth_place,biography,is_muggle FROM wizard WHERE birthday BETWEEN '1975-01-01' AND '1985-12-31';
+-----------+----------+------------+-------------+---------------------------------------+-----------+
| firstname | lastname | birthday | birth_place | biography | is_muggle |
+-----------+----------+------------+-------------+---------------------------------------+-----------+
| harry | potter | 1980-07-31 | london | | 0 |
mysql> SELECT * FROM school;
Empty set (0,00 sec)
mysql> INSERT INTO school (name, country, capacity) VALUES ('Beauxbatons Academy of Magic', 'France', 550) , ('Castelobruxo ', 'Brazil', 380), ('Durmstrang Institute', 'Norway', 570), ('Hogwarts School of Witchcraft and Wizardry', 'United Kingdom', 450), ('Ilvermorny School of Witchcraft and Wizardry', 'USA', 300), ('Koldovstoretz', 'Russia', 125), ('Mahoutokoro School of Magic', 'Japan', 800), ('Uagadou School of Magic', 'Uganda', 350);
Query OK, 8 rows affected (0,02 sec)
Records: 8 Duplicates: 0 Warnings: 0
mysql> SELECT * FROM school; +----+----------------------------------------------+----------+----------------+
| id | name | capacity | country |
+----+----------------------------------------------+----------+----------------+