Skip to content

Instantly share code, notes, and snippets.

View andrewfinnell's full-sized avatar

Andrew T. Finnell andrewfinnell

View GitHub Profile
const inquirer = require('inquirer');
const fs = require('fs');
const CHOICES = fs.readdirSync(`${__dirname}/templates`);
const QUESTIONS = [
{
name: 'project-choice',
type: 'list',
message: 'What project template would you like to generate?',
@andrewfinnell
andrewfinnell / jwtRS256.sh
Created April 20, 2018 18:09 — forked from ygotthilf/jwtRS256.sh
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
@andrewfinnell
andrewfinnell / app.js
Created April 12, 2018 15:43 — forked from ArVan/app.js
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');
@andrewfinnell
andrewfinnell / 01_setup_lets_encrypt.sh
Created January 8, 2018 18:09 — forked from gene1wood/01_setup_lets_encrypt.sh
Example of how to setup Let's Encrypt on RHEL / CentOS and automate certificate rewnewal
#!/bin/bash
EMAIL=john.doe@example.com
DOMAINS=example.com,www.example.com,foo.example.com,example.org.example.net,www.example.org,www.example.net
git clone https://github.com/letsencrypt/letsencrypt
cd letsencrypt/
mkdir -p /var/lib/letsencrypt/global-webroot
# Setup the global alias
@andrewfinnell
andrewfinnell / .gitconfig
Created June 18, 2017 18:20 — forked from shawndumas/.gitconfig
Using WinMerge as the git Diff/Merge Tool on Windows 64bit
[mergetool]
prompt = false
keepBackup = false
keepTemporaries = false
[merge]
tool = winmerge
[mergetool "winmerge"]
name = WinMerge
@andrewfinnell
andrewfinnell / credit-card-country-list-select
Created January 16, 2017 00:31
HTML country list select with 3 letter ISO country code values based on PayPal's 190 supported countries.
<select name="countries">
<option value="USA" selected>United States</option>
<option value="GBR">United Kingdom</option>
<option value="AUS">Australia</option>
<option value="CAN">Canada</option>
<option value="IND">India</option>
<option value="BRA">Brazil</option>
<option value="">-------------------------------</option>
<option value="ALB">Albania</option>
<option value="DZA">Algeria</option>
@andrewfinnell
andrewfinnell / node-folder-structure-options.md
Created November 1, 2016 18:38 — forked from lancejpollard/node-folder-structure-options.md
What is your folder-structure preference for a large-scale Node.js project?

What is your folder-structure preference for a large-scale Node.js project?

0: Starting from Rails

This is the reference point. All the other options are based off this.

|-- app
|   |-- controllers
|   |   |-- admin
var path = require('path')
var childProcess = require('child_process')
var phantomjs = require('phantomjs')
var nodemailer = require("nodemailer");
// create reusable transport method (opens pool of SMTP connections)
var smtpTransport = nodemailer.createTransport("SMTP",{
service: "Gmail",
auth: {
user: "br****@gmail.com",