Skip to content

Instantly share code, notes, and snippets.

@zazapeta
zazapeta / auth.js
Created November 23, 2019 10:43
Password hashing/verifying in node.js using 'pbkdf2'
const crypto = require("crypto");
// larger numbers mean better security
const config = {
// size of the generated hash
hashBytes: 32,
// larger salt means hashed passwords are more resistant to rainbow table, but
// you get diminishing returns pretty fast
saltBytes: 16,
// more iterations means an attacker has to take longer to brute force an
@zazapeta
zazapeta / How to make assiocation with sequelize + migration (umzug)
Last active June 20, 2019 12:49
How to make assiocation + migration - the programmatic way - with sequelize
Simple gist on how to make assiocation and migration (with umzug) - the programmatic way - with sequelize
@zazapeta
zazapeta / sobad.js
Created February 26, 2019 22:58
OMG !
function getAllOffres() {
var partner = {
user_taskaction_partner_online: new Array(),
user_taskaction_partner_company: this.service.service_company,
user_taskaction_partner_xpto: new Array(),
}
for (let partenerindex in partner.user_taskaction_partner_company) {
partner.user_taskaction_partner_company[partenerindex].PRD_TITLE = partner.user_taskaction_partner_company[partenerindex].CMP_NAME;
@zazapeta
zazapeta / bonjour.sh
Created June 19, 2018 12:36
WCS_odyssey_unix_2 : Introduction au Shell
#!/bin/sh
echo 'Bonjour' $1
@zazapeta
zazapeta / history.log
Created June 19, 2018 09:48
WCS_odyssey_unix_1 : Introduction à Unix
1 ls *
2 ls
3 cat crimescene
4 head crimescene
5 head crimescene -20
6 head crimescene 20
7 head
8 head --help
9 head crimescene -n 20
10 head crimescene -n 50
@zazapeta
zazapeta / ga-cheatsheet.md
Last active May 11, 2021 14:37
Google analytics events cheatsheet

This is a google analytics events cheatsheet.

Understanding deeply Events:

@zazapeta
zazapeta / flex.less
Created December 15, 2016 18:07 — forked from codler/flex.less
Prefix flex for IE10 and Safari / iOS in LESS
/*! Prefix flex for IE10 and Safari / iOS in LESS
* https://gist.github.com/codler/2148ba4ff096a19f08ea
* Copyright (c) 2014 Han Lin Yap http://yap.nu; MIT license */
.display(@value) when (@value = flex) {
display: -ms-flexbox; // IE10
display: -webkit-flex; // Safari / iOS
}
.display(@value) when (@value = inline-flex) {
@zazapeta
zazapeta / KeystoneApiExample.md
Last active September 7, 2016 13:00 — forked from JedWatson/KeystoneApiExample.md
Example of how to scaffold API endpoints for Posts in a Keystone project (based on the yo keystone example).

This is an example of how to scaffold API endpoints to list / get / create / update / delete Posts in a Keystone website.

It's a modification of the default project created with the yo keystone generator (see https://github.com/JedWatson/generator-keystone)

Gists don't let you specify full paths, so in the project structure the files would be:

routes-index.js        -->    /routes/index.js         // modified to add the api endpoints
routes-api-posts.js    -->    /routes/api/posts.js     // new file containing the Post API route controllers
@zazapeta
zazapeta / bobp-python.md
Created November 11, 2015 17:36 — forked from sloria/bobp-python.md
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens