Skip to content

Instantly share code, notes, and snippets.

@cormobro
cormobro / Makefile
Created Jan 8, 2020
makefile felix
View Makefile
NAME=libft.a
CC=gcc
CFLAGS=-Wall -Wextra -Werror
RM=rm -f
LDLIBS=-lft
View dwssap.sh
cat /etc/passwd | grep "*:" | cut -d ":" -f1 | sed -n 'n;p' | rev | sort -r | awk 'NR >= '$FT_LINE1' && NR <= '$FT_LINE2'' | tr '\n' ',' | sed '$ s/.$/./' | sed 's/, */, /g'
@cormobro
cormobro / Inpace.sql
Created Mar 16, 2019
base de donnees Inpace
View Inpace.sql
CREATE TABLE Prix (
id_pr int,
cluxe_pr int NOT NULL,
csobre_pr int NOT NULL,
cstandard_pr int NOT NULL,
fsobre_pr int NOT NULL,
fluxe_pr int NOT NULL,
fstandard_pr int NOT NULL,
PRIMARY KEY (id_pr)
);
View query.sql
-- #1
SELECT nom, salaire FROM `equipe` WHERE campus_mgr IS NULL
-- #2
SELECT IF(id_camp=140, "#####", nom) FROM `equipe`
-- #3
SELECT nom, SUBSTR(date_embauche, 6, 2) FROM `equipe`
-- #4
SELECT nom, IF(SUBSTR(date_embauche, 1, 4)!=2017, "13", 13 - SUBSTR(date_embauche, 6, 2)) FROM `equipe`
-- #5
SELECT nom, fonction, date_embauche, campus.nom_camp, campus.nom_camp FROM `equipe` INNER JOIN campus ON equipe.id_camp=campus.id_camp WHERE campus.nom_camp="nurn"
@cormobro
cormobro / index.js
Last active Jan 14, 2019
send mail
View index.js
var express = require('express');
var router = express.Router();
const nodemailer = require("nodemailer");
/* GET home page. */
router.get('/', function(req, res, next) {
res.render('index', { title: 'Express' });
});
router.get('/askForCookiesRecipe', function(req, res, next) {
View index.js
var express = require('express');
var router = express.Router();
/* GET home page. */
router.get('/', function(req, res, next) {
res.render('index', { title: 'Express' });
});
router.get('/superMiddleware', (req, res, next) => {
console.log("hello middleware");
@cormobro
cormobro / queries.sql
Created Jan 10, 2019
queries for sql
View queries.sql
-- #1
SELECT id_camp, localite FROM `campus` WHERE 1;
-- #2
SELECT equipe.nom, campus.nom_camp FROM equipe INNER JOIN campus ON equipe.id_camp=campus.id_camp;
-- #3
SELECT nom FROM `equipe` WHERE fonction="assistant" AND id_camp > 120
-- #4
SELECT nom FROM `equipe` WHERE fonction!="assistant" AND date_embauche LIKE "2017%"
-- #5
SELECT nom FROM `equipe` WHERE nom LIKE "%a%" AND nom LIKE "%r%"
@cormobro
cormobro / bonaert_f_wcs_bruxelles2.sql
Created Jan 8, 2019
bonaert_f_wcs_bruxelles2.sql
View bonaert_f_wcs_bruxelles2.sql
-- MySQL dump 10.13 Distrib 5.7.23, for osx10.9 (x86_64)
--
-- Host: localhost Database: sql3
-- ------------------------------------------------------
-- Server version 5.7.23
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
View index.js
var express = require('express');
var router = express.Router();
/* PUT */
router.put('/:name', function(req, res, next) {
res.send('Hey my name is'+ req.params.name);
});
/* DELETE */
View gist:f6d07edc298abe9e8330fa6bfc188825
-- MySQL dump 10.13 Distrib 5.7.24, for Linux (x86_64)
--
-- Host: localhost Database: felix_b_wcs_bruxelles
-- ------------------------------------------------------
-- Server version 5.7.24-0ubuntu0.18.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;