Skip to content

Instantly share code, notes, and snippets.

View braitsch's full-sized avatar

Stephen Braitsch braitsch

View GitHub Profile
@braitsch
braitsch / Node Server Setup 2023.md
Last active June 5, 2023 17:25
How to setup a Node.js + MongoDB environment and run apps with PM2 and SSL.

Node + MongoDB Server Setup Ubuntu 22.04 LTS

How to setup a Node.js + MongoDB environment with PM2 and Let's Encrypt

Login to your server as root

ssh root@your_server_ip

Update the system before doing anything

@braitsch
braitsch / OpenALPR.md
Created July 25, 2019 03:41
OpenALPR for Ubuntu 18.04

OpenALPR for Ubuntu 18.04

This is a slightly modified update to Daniel Kornev's excellent post which goes into more detail about why building from source is necessary on 18.04. His post was missing a few dependencies that I didn't have installed namely cmake, opencv and pkg-config. The following steps should get you a working build of openalpr on a fresh install of Ubuntu 18.04.


If you're not working with a fresh install, this might be a good time to clean and update your system before proceeding. (Optional)
$ sudo apt update #fetch list of available updates
$ sudo apt upgrade #install updates – does not remove packages
@braitsch
braitsch / gist:0509bcf788a8b7320f32
Last active October 23, 2023 11:43
TinyLCD Setup
@braitsch
braitsch / Git Purge
Last active February 18, 2022 16:17
Bash script to nuke unwanted files from the history of a git repository
# Bash script to nuke unwanted files from the history of a git repository
# Modification of David Underhill's script http://dound.com/2009/04/git-forever-remove-files-or-folders-from-history/
# http://stackoverflow.com/questions/2100907/how-do-i-purge-a-huge-file-from-commits-in-git-history
# usage : execute from repository root ./git-purge.sh "path to unwanted files"
#!/bin/bash
set -o errexit
if [ $# -eq 0 ]; then
@braitsch
braitsch / JavaScript Event Dispatcher
Last active October 14, 2015 00:28
Simple Event Dispatcher to register any Object or DOM element to listen for custom events and take appropriate action based on who dispatched it.
/*
Simple Event Dispatcher
Author : Stephen Braitsch
------------------------------------------------------------------
Example Usage :
var MY_CUSTOM_EVENT = 'my-custom-event';
var myObj = { name : 'stephen'};