A Pen by Trevor Clarke on CodePen.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var child_process = require('child_process'), | |
http = require('http'); | |
url = require('url'), | |
ffmpeg = null; | |
var livestream = function (req, resp) { | |
// For live streaming, create a fragmented MP4 file with empty moov (no seeking possible). | |
var input = 'udp://225.1.1.1:8208'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Author: @trevorjtclarke | |
# Initialize a deployment based on your environment | |
deployEnv='dev' | |
branch=`git rev-parse --abbrev-ref HEAD` | |
message=`git log -1 --pretty=%B` | |
versionstring=`grep 'version":[^"]*"' package.json` | |
version='-' | |
emoji=':clap:' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// time-long | |
// a component for verbal timestamps | |
time-long { | |
display: block; | |
position: relative; | |
svg { | |
fill: grey; | |
display: inline-block; | |
vertical-align: top; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* MutationObserver Example | |
* | |
* A quick reminder for later use | |
*/ | |
// prolly do this? | |
window.MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Patterns | |
// -------------------------------------------------- | |
// The following are take directly from: | |
// http://lea.verou.me/css3patterns/# | |
// | |
// Made into mixins for ease of use! | |
// Example: @include pt-shippo(#foo, 80px); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Helper function to extract claims from a JWT. Does *not* verify the | |
// validity of the token. | |
// credits: https://github.com/firebase/angularFire/blob/master/angularFire.js#L370 | |
// polyfill window.atob() for IE8: https://github.com/davidchambers/Base64.js | |
// or really fast Base64 by Fred Palmer: https://code.google.com/p/javascriptbase64/ | |
function deconstructJWT(token) { | |
var segments = token.split("."); | |
if (!segments instanceof Array || segments.length !== 3) { | |
throw new Error("Invalid JWT"); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var all = $('a[data-html="true"]'); | |
var done = []; | |
$.each(all, function(idx, item){ | |
var fin = $(item).parent().parent()[0].innerText.split('\n'); | |
var first = fin[0] + ';'; | |
var second = fin[1].split(' (')[0] + ';'; | |
var third = fin[1].split(' (')[1].replace(')', '') + '\n'; | |
var i = first + second + third; | |
done.push(i); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
::-moz-selection { background: yellow; } | |
::selection { background: yellow; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
// Licensed under a CC0 1.0 Universal (CC0 1.0) Public Domain Dedication | |
// http://creativecommons.org/publicdomain/zero/1.0/ | |
(function() { | |
// Update 'version' if you need to refresh the cache | |
var staticCacheName = 'static'; | |
var version = 'v1::'; |