Skip to content

Instantly share code, notes, and snippets.

@ArVan
ArVan / app.js
Last active March 11, 2021 03:06
JWT Authentication with Passport
var express = require('express');
var path = require('path');
var favicon = require('serve-favicon');
var logger = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
var index = require('./routes/index');
var user = require('./routes/user');
var auth = require('./routes/auth');
@ziluvatar
ziluvatar / token-generator.js
Last active April 11, 2024 07:10
Example of refreshing tokens with jwt
/**
* Example to refresh tokens using https://github.com/auth0/node-jsonwebtoken
* It was requested to be introduced at as part of the jsonwebtoken library,
* since we feel it does not add too much value but it will add code to mantain
* we won't include it.
*
* I create this gist just to help those who want to auto-refresh JWTs.
*/
const jwt = require('jsonwebtoken');
@InQuize
InQuize / Proxomox - NUT Client.md
Last active April 22, 2024 07:35
Proxomox - NUT Client.md
@evgenius
evgenius / onchange.sh
Last active December 15, 2018 22:17 — forked from senko/onchange.sh
#!/bin/bash
#
# Watch current directory (recursively) for file changes, and execute
# a command when a file or directory is created, modified or deleted.
#
# Written by: Senko Rasic <senko.rasic@dobarkod.hr>
#
# Requires Linux, bash and inotifywait (from inotify-tools package).
#
# To avoid executing the command multiple times when a sequence of