Skip to content

Instantly share code, notes, and snippets.

View quentin-aslan's full-sized avatar
🎯
Focusing

Quentin Aslan quentin-aslan

🎯
Focusing
View GitHub Profile
@PierreCavalet
PierreCavalet / passport.md
Created December 10, 2018 07:25
Authentification avec Passport.js

Authentification avec Passport.js

Passport.js est un middleware permettant de gérer l'authentification. Il s'intègre très bien avec Express.js. L'authentification est le processus de vérification qu'un utilisateur est bien celui qu'il prétend être.

Notre système d'authentification utilisera un JSON web token.

Comprendre ce qu'est un JSON web token (JWT)

Un JWT permet à un utilisateur de certifier certaines informations. Il est composé de 3 parties:

@Tiriel
Tiriel / encryption.js
Last active June 21, 2024 07:53
Symetric encryption/decryption for PHP and NodeJS communication
'use strict';
const crypto = require('crypto');
const AES_METHOD = 'aes-256-cbc';
const IV_LENGTH = 16; // For AES, this is always 16, checked with php
const password = 'lbwyBzfgzUIvXZFShJuikaWvLJhIVq36'; // Must be 256 bytes (32 characters)
function encrypt(text, password) {
@sid24rane
sid24rane / udp.js
Created July 25, 2016 08:39
Simple UDP Client and Server in Node.js ==> ( Echo Server )
var udp = require('dgram');
// --------------------creating a udp server --------------------
// creating a udp server
var server = udp.createSocket('udp4');
// emits when any error occurs
server.on('error',function(error){
console.log('Error: ' + error);
@rvl
rvl / git-pushing-multiple.rst
Created February 9, 2016 11:41
How to push to multiple git remotes at once. Useful if you keep mirrors of your repo.

Pushing to Multiple Git Repos

If a project has to have multiple git repos (e.g. Bitbucket and Github) then it's better that they remain in sync.

Usually this would involve pushing each branch to each repo in turn, but actually Git allows pushing to multiple repos in one go.

If in doubt about what git is doing when you run these commands, just

@quentin-aslan
quentin-aslan / Tchat_V1.py
Last active September 4, 2015 22:48
V1 du tchat CONSOLE
# ------------------------- #
# Code d'un tchat en reseau #
# Since 30/08/2015 #
# Created by Quentin Aslan #
# ------------------------- #
import os
from ftplib import FTP
pseudo = input("Salut, ton pseudo s'il te plait : ")
@pitch-gist
pitch-gist / gist:2999707
Created June 26, 2012 22:21
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>