Skip to content

Instantly share code, notes, and snippets.

View mmcc's full-sized avatar
📺
Movin vidja bits

Matthew McClure mmcc

📺
Movin vidja bits
View GitHub Profile
@mmcc
mmcc / tobias-encrypted.json
Created February 11, 2014 22:17
Encrypted HLS stream
{
"input": "s3://zencodertesting/tobias.mp4",
"output": [
{
"audio_bitrate": 64,
"audio_sample_rate": 22050,
"base_url": "s3://zencodertesting/tobias-encrypted/",
"filename": "file-64k.m3u8",
"format": "aac",
"public": 1,
@mmcc
mmcc / keybase.md
Last active August 29, 2015 13:57
keybase verification

Keybase proof

I hereby claim:

  • I am mmcc on github.
  • I am mmcc (https://keybase.io/mmcc) on keybase.
  • I have a public key whose fingerprint is C593 0B26 13C5 134C A904 2CF0 EC2F 9549 C5B6 236A

To claim this, I am signing this object:

@mmcc
mmcc / eventsource.js
Created July 17, 2014 07:46
EventSource example
function initEventSource(route) {
var source = new EventSource(route);
source.onopen = connectionEstablished;
source.onmessage = messageReceived;
source.onerror = connectionError;
return source;
}
@mmcc
mmcc / s3-watch.js
Created October 2, 2014 01:14
Basic Zencoder watch script for s3.
var path = require('path');
var zencoder = require('zencoder')();
var AWS = require('aws-sdk');
var _ = require('lodash');
// I need to use this on my personal machine to load the correct credentials from my AWS config
// This isn't necessary if you're doing something like setting ENV variables
var credentials = new AWS.SharedIniFileCredentials({profile: 'some-aws-credentials'});
AWS.config.credentials = credentials;
@mmcc
mmcc / slack-import.js
Created December 10, 2014 00:32
Had trouble with too many temporary accounts on slack import, so hacked this together.
var $selects = $('.user_map_selector select');
var throwAwayEmail = function(index) {
return 'oldsupportacct+'+ getRandomInt(2500, 99999) +'@zencoder.com';
}
function getRandomInt(min, max) {
return Math.floor(Math.random() * (max - min)) + min;
}
var count = 0;
@mmcc
mmcc / suite.js
Created December 11, 2014 21:43
chain smoker example config
var Suite = {};
function getRandomInt(min, max) {
return Math.floor(Math.random() * (max - min)) + min;
}
Suite.tests = [
{
name: 'Test Delivery',
address: 'http://www.example.com/accounts/'+ getRandomInt(100, 999) +'/subscriptions',
@mmcc
mmcc / stringificated.js
Last active August 29, 2015 14:12
Stringifying strings
var blah = { foo: "bar", neat: "true", something: "{\"cool\": \"not\"}"}
// { foo: 'bar',
// neat: 'true',
// something: '{"cool": "not"}' }
// So far, so good.
var stringified = JSON.stringify(blah)
// '{"foo":"bar","neat":"true","something":"{\\"cool\\": \\"not\\"}"}'
// Not what we wanted, but this is reasonable and expected.
@mmcc
mmcc / index.html
Created March 27, 2015 17:33
HTML5 boilerplate
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Awesome Boilerplate</title>
<link rel="stylesheet" href="css/main.css">
</head>
@mmcc
mmcc / base_controller_decorator.rb
Created November 29, 2011 23:45
Content Controller Decorator dump
Spree::BaseController.class_eval do
before_filter :adjust_format_for_iphone
# before_filter :iphone_login_required
respond_to do |format|
format.iphone { render :layout => false }
end
private
@mmcc
mmcc / fulltrace
Created November 30, 2011 00:51
Full Trace after adding home controller decorator
spree_core (0.70.3) app/views/shared/_products.html.erb:5:in `___ibrary__uby__ems_____gems_spree_core________app_views_shared__products_html_erb___911215525_2255387160'
actionpack (3.1.1) lib/action_view/template.rb:144:in `send'
actionpack (3.1.1) lib/action_view/template.rb:144:in `render'
activesupport (3.1.1) lib/active_support/notifications.rb:55:in `instrument'
actionpack (3.1.1) lib/action_view/template.rb:142:in `render'
actionpack (3.1.1) lib/action_view/renderer/partial_renderer.rb:256:in `render_partial'
actionpack (3.1.1) lib/action_view/renderer/partial_renderer.rb:228:in `render'
actionpack (3.1.1) lib/action_view/renderer/abstract_renderer.rb:33:in `instrument'
activesupport (3.1.1) lib/active_support/notifications.rb:53:in `instrument'
activesupport (3.1.1) lib/active_support/notifications/instrumenter.rb:21:in `instrument'