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 / 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>
@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 / 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:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Contact PLAYBOOK | Your Phoenix Family Fun Guide! Helping you find kid-Friendly activites, events, outings for families that are educational and fun for kids of all ages, serving the West Valley of Phoenix, AZ</title>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta name="description" content="Phoenix Family Fun Guide to activites, outings, educational trips, dance lessons that are educational and fun serving the Valley of the Sun in Phoenix Arizona, our phoenix kids directory serving Peoria, AZ and Glendale, AZ, Surprise, AZ, and Scottsdale, AZ" />
@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 / gist:6324152
Last active December 21, 2015 15:08
IAM Policy which allows for basic ElasticBeanstalk usage.
{
"Statement": [
{
"Effect": "Allow",
"Action": [
"elasticbeanstalk:*",
"ec2:*",
"elasticloadbalancing:*",
"cloudformation:*",
"autoscaling:*",
@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 / 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 / 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) => {