Skip to content

Instantly share code, notes, and snippets.

View jwrigh26's full-sized avatar

Justin Wright jwrigh26

  • United States
View GitHub Profile
@jwrigh26
jwrigh26 / node_nginx_ssl.md
Created October 15, 2021 03:19 — forked from bradtraversy/node_nginx_ssl.md
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

// Matches
// values: be90d703-4671-4024-9a20-bf4c42d5 from
// URL: .../accruals.html#/accruals-wizard/be90d703-4671-4024-9a20-bf4c42d5/create
const foo = {
fooIdFromPathname: pathname => {
const regex = new RegExp(
`^(?:.*)(?:(?:herp-dirp\/)|(?:foo\/))([a-zA-z0-9-]*)(?:\/)(?:(?:.*))?`
);
const results = regex.exec(pathname) ?? [];
@jwrigh26
jwrigh26 / VSCode User settings
Created February 16, 2023 23:11
My horrible VSCode user settings
{
"workbench.iconTheme": "material-icon-theme",
// "workbench.editor.showTabs": false,
"[javascript]": {
"editor.formatOnSave": false,
"editor.insertSpaces": true,
"editor.tabSize": 2,
"editor.detectIndentation": false,
},
"[json]": {
@jwrigh26
jwrigh26 / VS Code JS Snippets
Created February 16, 2023 23:12
My JS Snippets
{
// Place your snippets for javascript here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
"Log value to console": {
"prefix": "lg-var",
"body": ["console.log($1);", "$2"],
"description": "Log value and string output to console"