Skip to content

Instantly share code, notes, and snippets.

View JRJurman's full-sized avatar

Jesse Jurman JRJurman

View GitHub Profile
@JRJurman
JRJurman / crop.m
Last active February 11, 2016 16:00
% load image
orig = imread('jurman_lumiaicon.jpg');
% chartTopLeft and chartBotRight
ctl = [458 331];
cbr = [3926 2742];
% crop with the corners of the image
cropChart = orig(ctl(2):cbr(2),ctl(1):cbr(1),:);

The Lambda Theater

Somewhere in upstate NY, there's a small theater that's trying to improve their software systems. There's a series of problems they need to solve though, and they want to do them all with functional solutions, involving Filter, Map, and Reduce. You'll have to deal with their Members, Big Data Scientists, and Russia to solve all the problems listed below. To make it a little easier, we've provided some sample data for you to play around with.

Easy (The Ticket Booth)

<!DOCTYPE html>
<html>
<body>
<canvas id="myCanvas" width="250" height="150" style="border:1px solid #d3d3d3;">
Your browser does not support the HTML5 canvas tag.</canvas>
<script>
var boxCounter = 0.0;
@JRJurman
JRJurman / ProxyServer.js
Created November 20, 2016 15:36
Server Made to Handle non-existant routes for static app
// ProxyServer.js
// Server to handle routes that don't actually exist
// Created by Jesse Jurman
"use strict";
const express = require('express');
const proxy = require('proxy-middleware');
const url = require('url');
function startProxy(staticHost) {
{
"swagger" : "2.0",
"info" : {
"version" : "0.0.200-SNAPSHOT",
"title" : "rest-client-swagger"
},
"tags" : [ {
"name" : "CollectorController",
"description" : "Controller to Fetch and Create Survey-Svc Collectors"
}, {
@JRJurman
JRJurman / led.js
Last active October 5, 2018 23:13
Binary Clock Examples for Medium Article
const Tram = require('tram-one')
const html = Tram.html()
module.exports = (attrs) => {
const style = `
width: ${attrs.size};
height: ${attrs.size};
background: ${attrs.on ? 'blue' : 'lightblue'};
border-radius: 50%;
margin: 0.3em;
@JRJurman
JRJurman / digit.js
Last active October 6, 2018 15:44
Digit for Binary Clock Medium Article
const Tram = require('tram-one')
const html = Tram.html({
'led': require('./led')
})
module.exports = (attrs) => {
const binaryValue = parseInt(attrs.value).toString(2)
const fullBinaryString = '0000'.slice(0, 4 - binaryValue.length).concat(binaryValue)
const isOn = fullBinaryString.split('').map(value => value === '1')
@JRJurman
JRJurman / clock.js
Last active October 6, 2018 01:27
Binary Clock Actions
module.exports = {
init: () => new Date(),
tick: () => new Date()
}
const Tram = require('tram-one')
const html = Tram.html({
'digit': require('../elements/digit')
})
module.exports = (attrs) => {
const {clock} = window.engine.store
const style = `
display: flex;
justify-content: center;