Skip to content

Instantly share code, notes, and snippets.

View michaelerobertsjr's full-sized avatar

Mike Roberts michaelerobertsjr

View GitHub Profile
@michaelerobertsjr
michaelerobertsjr / .gitignore
Created July 26, 2020 21:39 — forked from pdxjohnny/.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
@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 / 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
# 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 / 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);
@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 / 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 / roles_invesitgation.md
Created July 27, 2017 19:00 — forked from facultymatt/roles_invesitgation.md
Roles and permissions system for Nodejs
@michaelerobertsjr
michaelerobertsjr / react.md
Last active June 30, 2017 03:40
Resources to learn React

Resources for Learning React

Course

Complete the React Basics course on Team Treehouse, or the equivelant on CodeSchool, PluralSight, etc.

Read

Read Thinking in React and quickly review the React docs.

Watch

Watch Thinking in React follow along carefully and if time permits build the project along side watching.

@michaelerobertsjr
michaelerobertsjr / example.cs
Created June 5, 2017 21:57 — forked from brandonmwest/example.cs
Generating base64-encoded Authorization headers in a variety of languages
httpClient.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue(
"Basic",
Convert.ToBase64String(
System.Text.ASCIIEncoding.ASCII.GetBytes(
string.Format("{0}:{1}", username, password))));