Skip to content

Instantly share code, notes, and snippets.

View bsommardahl's full-sized avatar

Byron Sommardahl bsommardahl

View GitHub Profile

[Design] Pattern Master

This criteria serves as the badge criteria for all design patterns.

Champion

Competencies:

@bsommardahl
bsommardahl / install-gitlab-docker.md
Last active October 23, 2018 23:23
Install Docker and Gitlab-Runner on Ubuntu VM/Instance

Use Ubuntu 18 only. No mint!

After starting a clean instance, proceed with the following commands:

Install Gitlab-Runner:

sudo apt-get update

curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.deb.sh | sudo bash
@bsommardahl
bsommardahl / backend.md
Created May 17, 2018 15:26
Description of back-end.

Components

IDP

The "Identity Provider" (IDP) can be anything that produces a properly signed JWT. The only requirement is that the IDP use the same secret key for signing since the broker will verify the JWT before passing on requests.

For now, we will use Auth0 as our IDP since it is easy to get moving. However, any other IDP will do. For example, if we need to work with Microsoft systems, a simple adapter could be built to convert whatever horrible XML mess they send us into a nice clean JWT.

When connecting to the broker, you must include use "JWT" as the username and the actual signed JWT string as the password.

@bsommardahl
bsommardahl / moscaError
Created May 17, 2018 12:23
Mosca Output at Error
Mosca server is up and running
{"pid":6798,"hostname":"byron-virtual-machine","name":"mosca","level":30,"time":1526558598890,"msg":"authentication denied","client":"mqttjs_5679f3cb","v":1}
{"pid":6798,"hostname":"byron-virtual-machine","name":"mosca","level":30,"time":1526558598893,"msg":"authentication denied","client":"mqttjs_11a65328","v":1}
events.js:167
throw er; // Unhandled 'error' event
^
Error: Connection refused: Not authorized
at MqttClient._handleConnack (/home/byron/node-typescript-boilerplate/node_modules/mqtt/lib/client.js:893:15)
@bsommardahl
bsommardahl / install_error.txt
Created March 14, 2018 13:26
Reason 3.1.0 Install Error on Linux Mint Sylvia
byron@mint-dev-2 ~/Projects/cafe-frontend $ sudo npm i -g reason-cli@3.1.0-linux --unsafe-perm
/usr/bin/ocamlmerlin -> /usr/lib/node_modules/reason-cli/.bin/ocamlmerlin
/usr/bin/ocamlmerlin-reason -> /usr/lib/node_modules/reason-cli/.bin/ocamlmerlin-reason
/usr/bin/rtop -> /usr/lib/node_modules/reason-cli/.bin/rtop
/usr/bin/utop -> /usr/lib/node_modules/reason-cli/.bin/utop
/usr/bin/refmttype -> /usr/lib/node_modules/reason-cli/.bin/refmttype
/usr/bin/reopt -> /usr/lib/node_modules/reason-cli/.bin/reopt
/usr/bin/rebuild -> /usr/lib/node_modules/reason-cli/.bin/rebuild
/usr/bin/reactjs_jsx_ppx_v2 -> /usr/lib/node_modules/reason-cli/.bin/reactjs_jsx_ppx_v2
/usr/bin/reactjs_jsx_ppx_v3 -> /usr/lib/node_modules/reason-cli/.bin/reactjs_jsx_ppx_v3
@bsommardahl
bsommardahl / error.txt
Created March 13, 2018 17:55
Reason-cli 3.1.0 installation errors
byron@ubuntu:~$ sudo npm i -g reason-cli@3.1.0-linux
/usr/bin/ocamlmerlin -> /usr/lib/node_modules/reason-cli/.bin/ocamlmerlin
/usr/bin/ocamlmerlin-reason -> /usr/lib/node_modules/reason-cli/.bin/ocamlmerlin-reason
/usr/bin/rtop -> /usr/lib/node_modules/reason-cli/.bin/rtop
/usr/bin/utop -> /usr/lib/node_modules/reason-cli/.bin/utop
/usr/bin/refmt -> /usr/lib/node_modules/reason-cli/.bin/refmt
/usr/bin/refmttype -> /usr/lib/node_modules/reason-cli/.bin/refmttype
/usr/bin/reopt -> /usr/lib/node_modules/reason-cli/.bin/reopt
/usr/bin/reactjs_jsx_ppx_v2 -> /usr/lib/node_modules/reason-cli/.bin/reactjs_jsx_ppx_v2
/usr/bin/reactjs_jsx_ppx_v3 -> /usr/lib/node_modules/reason-cli/.bin/reactjs_jsx_ppx_v3
@bsommardahl
bsommardahl / breezy.js
Created October 24, 2017 21:31
A simple API wrapper for some functions from Breezy HR
const request = require("request-promise");
const base = "https://breezy.hr/public/api/v2";
let token = false;
const breezy = {
login: async function(email, password) {
const opts = {
method: "POST",
uri: `${base}/signin`,
body: { email, password },
json: true
@bsommardahl
bsommardahl / ideal_starting.md
Last active May 7, 2019 14:20
Ideal Starting Point for Acklen Avenue Projects

What would be the ideal starting point for any Acklen Avenue software project?

Developer's Coding Environment

  • Wallaby.js working for all popular editors
  • Live debug set up in all popular editors (those that can debug, that is)
  • Works in Windows, OSX and Linux.

Boilerplate

  • Frontend is architected to be a large application.
@bsommardahl
bsommardahl / attempt-failing.js
Last active June 2, 2017 15:47
ForEach Testing Example
console.log(0);
console.log(1);
console.log(2);
console.log(3);
console.log(4);
console.log(5);
console.log(6);
console.log(7);
console.log(8);
console.log(9);
public updateTask(request: Hapi.Request, reply: Hapi.IReply) {
let userId = request.auth.credentials.id;
let id = request.params["id"];
let task: ITask = request.payload;
//the database needs to be wrapped in a Reader here.
this.database.taskModel.findByIdAndUpdate({ _id: id, userId: userId }, { $set: task }, { new: true })
.then((updatedTask: ITask) => {
//this if needs to be replaced by a monad here.
if (updatedTask) {