Skip to content

Instantly share code, notes, and snippets.

View boushley's full-sized avatar

Aaron Boushley boushley

  • Songtradr
  • Seattle, WA
View GitHub Profile
<!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 / gist:5471599
Last active May 17, 2019 09:11
A JavaScript UTF-8 decoding function for ArrayBuffers. Credit for most of the heavy lifting goes to "bob" http://ciaranj.blogspot.com/2007/11/utf8-characters-encoding-in-javascript.html
function decodeUtf8(arrayBuffer) {
var result = "";
var i = 0;
var c = 0;
var c1 = 0;
var c2 = 0;
var data = new Uint8Array(arrayBuffer);
// If we have a BOM skip it
@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 / 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:

@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 / 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 / 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) {