Skip to content

Instantly share code, notes, and snippets.

View bennage's full-sized avatar
📺
please stay tuned

Christopher Bennage bennage

📺
please stay tuned
View GitHub Profile
@bennage
bennage / example.deploy.json
Last active April 28, 2021 16:57
assigning a role for storage access
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"guid": {
"type": "string",
"defaultValue": "[newGuid()]"
}
},
"variables": {
@bennage
bennage / clean-up.sh
Created April 22, 2021 17:33
bash script for deleting all resource groups matching a pattern
#!/usr/bin/env bash
groups=$(az group list --query "[?contains(name,'bennage')].name")
for row in $(echo "${groups}" | jq -r '.[]'); do
_remove() {
echo ${row}
az group delete -y --no-wait -g ${row}
}
@bennage
bennage / deployment-test.md
Created March 17, 2021 16:42
testing the Percept deployment

Deploy to Azure

// This F# dojo is directly inspired by the
// Digit Recognizer competition from Kaggle.com:
// http://www.kaggle.com/c/digit-recognizer
// The datasets below are simply shorter versions of
// the training dataset from Kaggle.
// The goal of the dojo will be to
// create a classifier that uses training data
// to recognize hand-written digits, and
// evaluate the quality of our classifier

The Old Monster Shop

The Old Monster Shop is a pre-Time of Troubles Forgotten Realms campaign using Dungeon World instead of AD&D 2nd Edition.

Campaign Introduction

You are each one of the many Children of Helm, orphans raised at Helm's Hold southeast of Neverwinter. The monastery is all you've known, but you're now the age where you must enter the world and live by your own means. But before your life is truly your own, you must make a final oblation to Helm, in service to the Hold. You will travel to the City of Splendors, Waterdeep, and gain the trust of an evil monster-peddler there named Feldyn. What you will do with his trust, and when, is a secret that Watcher Dumal Erard has not yet shared.

But Dumal is like a father to you, a parent in lieu of those you lost, and you trust him completely. His instructions, and his plan for gaining Feldyn's trust, are simple, but will be hazardous. Because Feldyn only retains people he knows and trusts, you will start by selling him young monsters and monst

@bennage
bennage / count_change.fs
Created September 19, 2013 00:47
An F# implementation of the counting change problem's solution, following the clojure example from this post: http://www.billthelizard.com/2010/12/sicp-219-counting-change-revisited.html Can you improve it?
open System;
open System.Diagnostics;
[<EntryPoint>]
let main argv =
let rec cc amount coins =
match (amount, coins) with
| (0,_) -> 1
| (_,[]) -> 0
| (amount,_) when amount < 0 -> 0
@bennage
bennage / sfx.js
Created June 20, 2013 03:59
simple implementation of pooling audio elements
define(function() {
var pools = {};
var tags = {};
var manifest = {
'laser': ['sfx/laser.wav', 2],
'explosion': ['sfx/explosion.wav', 8]
};
function createTag(src, whenReady) {
@bennage
bennage / enemy.js
Last active December 14, 2015 12:08
an enemy ship for our simple game that creates and tracks a phantom target
// alias (and pre-compute) the angle of
// a full circle (360°, but in radians)
var fullCircle = Math.PI * 2;
// invoke this function to create an emeny ship entity
// to add to the main game screen
function makeEnemyShip(x, y) {
// position is set based upon the values
// provided to the function
@bennage
bennage / mainGameScreen.js
Last active December 14, 2015 11:19
simple implementation of the main game screen, tracking a set of "enemy" units
var mainGameScreen = (function () {
// the set of entities we're updating and rendering
var entities = [];
// how many enemy ships do we want to start with
var numOfEnemyShips = 12;
// intitalize the screen, expected to be called
// once when transitioning to the screen
function start() {
@bennage
bennage / startScreen.js
Last active December 10, 2015 02:58
basic logic for a start screen (the main menu) of my game
// `input` will be defined elsewhere, it's a means
// for us to capture the state of input from the player
var startScreen = (function(input) {
// the red component of rgb
var hue = 0;
// are we moving toward red or black?
var direction = 1;
var transitioning = false;