$ docker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Original article | |
//https://jonathanmh.com/express-passport-json-web-token-jwt-authentication-beginners/ | |
//loadash is stupid bloatware stop using it | |
//var _ = require("lodash"); | |
var express = require("express"); | |
var bodyParser = require("body-parser"); | |
var jwt = require('jsonwebtoken'); | |
var passport = require("passport"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
#This script assumes very little other than a fresh Ubuntu install (using the Windows store) on Win10 1709 or newer with WSL installed already | |
#In Powershell, run the following to install WSL and Ubuntu | |
# | |
#Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux | |
#Invoke-WebRequest -Uri https://aka.ms/wsl-ubuntu-1604 -OutFile ~/Ubuntu.zip -UseBasicParsing | |
#Expand-Archive ~/Ubuntu.zip ~/Ubuntu | |
#~/Ubuntu/ubuntu.exe | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
REM IN YOUR SSL FOLDER, SAVE THIS FILE AS: makeCERT.bat | |
REM AT COMMAND LINE IN YOUR SSL FOLDER, RUN: makecert | |
REM IT WILL CREATE THESE FILES: example.cnf, example.crt, example.key | |
REM IMPORT THE .crt FILE INTO CHROME Trusted Root Certification Authorities | |
REM REMEMBER TO RESTART APACHE OR NGINX AFTER YOU CONFIGURE FOR THESE FILES | |
REM PLEASE UPDATE THE FOLLOWING VARIABLES FOR YOUR NEEDS. | |
SET HOSTNAME=example |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var BASE64_MARKER = ';base64,'; | |
function convertDataURIToBinary(dataURI) { | |
var base64Index = dataURI.indexOf(BASE64_MARKER) + BASE64_MARKER.length; | |
var base64 = dataURI.substring(base64Index); | |
var raw = window.atob(base64); | |
var rawLength = raw.length; | |
var array = new Uint8Array(new ArrayBuffer(rawLength)); | |
for(i = 0; i < rawLength; i++) { |