Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View boushley's full-sized avatar

Aaron Boushley boushley

  • Songtradr
  • Seattle, WA
View GitHub Profile
@boushley
boushley / dllBootstrapPlugin.js
Created May 15, 2017 20:19
Boostrap Webpack DLL Chunk
// This plugin modifies the generated webpack code to execute a module within the DLL bundle in addition to preserving
// the default behavior of exporting the webpack require function
class DllBootstrapPlugin {
constructor(options) {
this.options = options || {}
}
apply(compiler) {
compiler.plugin('compilation', (compilation) => {
compilation.mainTemplate.plugin('startup', (source, chunk) => {
@boushley
boushley / isobmff-mp4.grammar
Last active August 9, 2018 23:01
ISO BMFF - MP4 Grammar for Synalyze It
<?xml version="1.0" encoding="UTF-8"?>
<ufwb version="1.17">
<grammar name="ISOBMFF MP4" start="id:8" fileextension="mp4" uti="public.mpeg-4">
<structure name="Atom" id="9" length="Size" extends="id:10">
<number name="Size" id="11" fillcolor="68D6FB" type="integer" length="4">
<description>Atom Size</description>
</number>
<number name="Type" mustmatch="yes" id="12" fillcolor="FF7B7A" type="integer" length="4" display="hex">
<description>Atom Type</description>
</number>
@boushley
boushley / test-node-server.js
Created March 1, 2016 21:32
Example KOA Server to serve static files
var fs = require('fs');
var koa = require('koa');
var r = require('koa-route');
var bodyParser = require('koa-bodyparser');
var app = koa();
app.use(function *(next){
var start = new Date;
yield next;
var ms = new Date - start;
@boushley
boushley / dash-init-wait-time-calculation.js
Created January 16, 2016 00:15
An example of how you could calculate wait time without modifying or extending dash.js
(function(){
var videoElement = document.querySelector("#videoPlayer");
var url = "http://dash.edgesuite.net/envivio/Envivio-dash2/manifest.mpd";
var player = MediaPlayer().create();
player.initialize(videoElement, url, true);
var waitTimeStart;
videoElement.addEventListener('waiting', function() {
// If a second stream stalls keep the oldest start time
if (!waitTimeStart) {
@boushley
boushley / MockVideoElement.js
Created January 6, 2016 17:37
Mock Video Element for use with dash.js -- Not quite complete but gets the basics functional
function createMockVideoElement() {
"use strict";
var video = {};
video.__mock_listeners = {};
video.__mock_progress = function(toProgress) {
var endProgressAt = video.currentTime + toProgress;
video.__mock_fire_event('play');
@boushley
boushley / Console Commands
Last active September 22, 2015 22:43
JAWS Environment Variables
# List JAWS environment variables
# jaws env list [stage] [region]
jaws env list dev us-west-2 # This will show all environment variables for the stage `dev` in us-west-2
# Set an environment variable
# jaws env set [stage] [region] [key] [value]
jaws env set dev us-west-2 MY_ENV_VAR somevalue # This sets the environment variable `MY_ENV_VAR` to `somevalue` for the dev stage in us-west-2
@boushley
boushley / keybase.md
Created October 27, 2014 16:46
keybase.md

Keybase proof

I hereby claim:

  • I am boushley on github.
  • I am boushley (https://keybase.io/boushley) on keybase.
  • I have a public key whose fingerprint is DD4A ABD8 6F6C 5F8C 3675 29F2 8008 8EA6 F2C8 408D

To claim this, I am signing this object:

@boushley
boushley / Non Scalable Workaround
Created May 16, 2014 22:29
Non scalable way of including author templates
<div>
{{ if eq .Params.author "boushley" }}
{{ template "chrome/author/boushley.html" . }}
{{ else if ... }}
...
{{ end }}
</div>
@boushley
boushley / Dynamic template Inclusion
Last active August 29, 2015 14:01
Go Templates With Dynamic Template
<div>
{{ $foobar := printf `chrome/author/%s.html` .Params.author }}
{{ $foobar }} <!-- This prints "chrome/author/name.html" -->
{{ template $foobar . }} <!-- This blows up -->
{{ template "chrome/author/" + .Params.author + ".html" . }} <!-- This blows up -->
</div>