Skip to content

Instantly share code, notes, and snippets.

View wmandrews's full-sized avatar

Wilson Andrews wmandrews

View GitHub Profile
@wmandrews
wmandrews / gist:3fd61811a7097edfbe16
Created July 19, 2015 14:47
Image sequence to mp4/webm
ffmpeg -i %03d.png -c:v libvpx -crf 10 -b:v 1M -c:a libvorbis ../promo.webm
ffmpeg -framerate 24 -i %03d.png -c:v libx264 -r 30 -pix_fmt yuv420p ../promo.mp4
@wmandrews
wmandrews / script
Created May 31, 2015 20:21
Quick 'n' dirty image sequence to animated gif
# 100 = 1 frame per second
convert -delay 100 -loop 0 *.jpg animated.gif
@wmandrews
wmandrews / get-params.js
Created August 26, 2014 18:15
Get URL query parameters
// Returns the paramters as an object, key=>value pairs
function getParameters(url){
var paramList = [], params = {}, kvPairs, tmp;
url = (url !== '' && typeof url === 'string') ? url : document.URL;
if(url){
if(url.indexOf("?") !== -1){
paramList = url.split("?")[1];
if(paramList){
if(paramList.indexOf("&")){
kvPairs = paramList.split("&");
@wmandrews
wmandrews / balance.js
Created July 15, 2014 21:24
Balance yo' headlines (Require ready)
/*
* Copyright (c) 2012 Adobe Systems Incorporated. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@font-face {
font-family: 'StateFaceRegular';
src: url('http://www.washingtonpost.com/wp-srv/graphics/webfonts/stateface-regular-webfont.eot');
src: url('http://www.washingtonpost.com/wp-srv/graphics/webfonts/stateface-regular-webfont.eot?#iefix') format('embedded-opentype'),
url('http://www.washingtonpost.com/wp-srv/graphics/webfonts/stateface-regular-webfont.woff') format('woff'),
url('http://www.washingtonpost.com/wp-srv/graphics/webfonts/stateface-regular-webfont.ttf') format('truetype'),
url('http://www.washingtonpost.com/wp-srv/graphics/webfonts/stateface-regular-webfont.svg#StateFaceRegular') format('svg');
font-weight: normal;
font-style: normal;
}
@wmandrews
wmandrews / gist:10595297
Last active August 29, 2015 13:59
Grunt image and video optimize
'use strict';
module.exports = function(grunt) {
// paths used in our tasks
var tmpFolder = '.tmp/';
// src assets
var srcAssets = 'assets/',
srcImages = srcAssets + 'images/',
@wmandrews
wmandrews / gist:8723021
Created January 31, 2014 00:21
Require-ready SVG-Crowbar
require( [
'd3/3'
], function(d3) {
var doctype = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">';
window.URL = (window.URL || window.webkitURL);
var script = document.createElement('script');
script.onload = initialize;
@wmandrews
wmandrews / index.html
Created November 4, 2013 15:21
Soundcite example
<link href='//cdn.knightlab.com/libs/soundcite/latest/css/player.css' rel='stylesheet' type='text/css'><script type='text/javascript' src='//connect.soundcloud.com/sdk.js'></script><script type='text/javascript' src='//cdn.knightlab.com/libs/soundcite/latest/js/soundcite.min.js'></script>
<p>Obama <span class="soundcite" data-id="66458753" data-start="0" data-end="10000">gave his speech</span> to hundreds of followers in Chicago after his victory.</p>
@wmandrews
wmandrews / index.html
Last active December 26, 2015 17:29
MapBox JS starter code
<!DOCTYPE html>
<html>
<head>
<!-- sets up the page for responsive content / mobile friendly -->
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' />
<!-- imports the mapbox js library so we can use its functionality -->
<script src='http://api.tiles.mapbox.com/mapbox.js/v1.3.1/mapbox.js'></script>
<!-- imports the styles (CSS) for the mapbox library -->
@wmandrews
wmandrews / index.html
Last active December 25, 2015 12:19
Facebook IPO Chart
<iframe src="http://cf.datawrapper.de/0GmQE/1/" frameborder="0" allowtransparency="true" allowfullscreen="allowfullscreen" webkitallowfullscreen="webkitallowfullscreen" mozallowfullscreen="mozallowfullscreen" oallowfullscreen="oallowfullscreen" msallowfullscreen="msallowfullscreen" width="100%" height="400"></iframe>