Skip to content

Instantly share code, notes, and snippets.

View michaelerobertsjr's full-sized avatar

Mike Roberts michaelerobertsjr

View GitHub Profile
@michaelerobertsjr
michaelerobertsjr / roles_invesitgation.md
Created July 27, 2017 19:00 — forked from facultymatt/roles_invesitgation.md
Roles and permissions system for Nodejs
@michaelerobertsjr
michaelerobertsjr / app.js
Last active October 12, 2017 16:33
socket server with express
const Server = require('socket.io');
const app = express();
const server = http.createServer(app);
const io = new Server(server);
io.on('connection', (socket) => {
console.log(`Connection detected: ${socket.client.id}`);
socket.use(([name, data], next) => {
if (data.auth === process.env.SOCKET_KEY) {
return next();
@michaelerobertsjr
michaelerobertsjr / index.html
Last active August 28, 2018 21:07
Loopback socket.io example server/server.js
<!doctype html>
<html>
<head>
<title>Socket.IO chat</title>
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font: 13px Helvetica, Arial; }
form { background: #000; padding: 3px; position: fixed; bottom: 0; width: 100%; }
form input { border: 0; padding: 10px; width: 90%; margin-right: .5%; }
form button { width: 9%; background: rgb(130, 224, 255); border: none; padding: 10px; }
@michaelerobertsjr
michaelerobertsjr / server.spec.js
Created August 28, 2018 21:31
test a loopback model and server
const chai = require('chai');
const chaiHttp = require('chai-http');
const app = require('../../server/server');
const expect = chai.expect;
chai.use(chaiHttp);
describe('Server app', function mocha() {
this.timeout(6500);
# Loopback Workshop
---
## Overview
---
We are going to build out an API that will allow CRUD operations for Teams and Players, and query for players that belong to teams. This project is concerned with the back end, and doesn't need to have a front facing web app. The purpose of this workshop is to demonstrate how using a framework can make building and maintaining APIs easy.
## Prerequisites
---
@michaelerobertsjr
michaelerobertsjr / battleship.md
Created February 9, 2020 22:48
Battleship mob sessions

Battleship

A remake of the classic board game using javascript and html.

Suggested order of build

Start with User interface

  1. Display grid of given size
  2. Create a data structure to hold ships
@michaelerobertsjr
michaelerobertsjr / mob-coding-challenge.js
Created February 14, 2020 19:23
A saved mob programming session with Learn Teach Code!
// Type JavaScript here!
@michaelerobertsjr
michaelerobertsjr / .gitignore
Created July 26, 2020 21:39 — forked from johnandersen777/.gitignore
Setting Up k3s for Serverless (knative) on a $5 DigitalOcean Droplet Using k3d
.terraform/
*.pem
*.tf
*.tfstate
*.yaml
*.backup
istio-*/
cert-manager-*/
*.swp
env