Skip to content

Instantly share code, notes, and snippets.

View richtr's full-sized avatar

Rich Tibbett richtr

View GitHub Profile
@richtr
richtr / config.yml
Last active November 28, 2017 21:36
Parse YAML from bash with sed and awk.
development:
adapter: mysql2
encoding: utf8
database: my_database
username: root
password:
apt:
- somepackage
- anotherpackage
@richtr
richtr / blockstack-verification.txt
Created February 10, 2017 16:46
Verifying that "richtr.id" is my Blockstack ID. https://onename.com/richtr
Verifying that "richtr.id" is my Blockstack ID. https://onename.com/richtr
@richtr
richtr / logo_mediasession
Created June 30, 2015 10:10
Media Session Logo
<?xml version="1.0"?>
<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg">
<g>
<title>Layer 1</title>
<circle fill-opacity="0" id="svg_1" stroke-width="10" stroke="#3c790a" fill="#000000" r="45" cy="50" cx="50"/>
<rect stroke="#3c790a" id="svg_8" height="40.5" width="1.75" y="29.5" x="60.25" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" stroke-width="5" fill="#3c790a"/>
<path stroke="#3c790a" id="svg_6" d="m31.25,32.631443l0.5,33.819592l22,-16.816372l-22.5,-17.00322z" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" stroke-width="5" fill="#3c790a"/>
<rect stroke="#3c790a" id="svg_9" height="40.5" width="1.75" y="29.5" x="70.375" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" stroke-width="5" fill="#3c790a"/>
</g>
</svg>
@richtr
richtr / gist:2235fdae25c74186297d
Last active August 29, 2015 14:13
General considerations for Media Focus scoping, lifecycle and events

Media Focus Scope

  • At what level should Media Focus be requested and granted/revoked?

    • Per Tab(s)
      • Per Origin(s)
        • Per Document(s)
          • Per Media Grouping(s)
            • Per Media Object(s)
  • High-level vs. Low-level scope - what are the pros and cons of setting the media focus scope at these different levels? Do we want audio focus to be set and applied implicitly to tab/document/origin content or explicitly to in-page media groupings or elements?

@richtr
richtr / SensorCheck.js
Created September 23, 2014 14:21
A reliable DeviceOrientation and DeviceMotion Events API feature detection library
/**
* DeviceOrientation and DeviceMotion Events Detection API
*
* Example API Usage (Promise-based API):
*
* supportsDeviceOrientationEvents().then(function() {
* console.log("Platform DeviceOrientation Events support OK");
* }, function(error) {
* console.error("Platform DeviceOrientation Events support KO");
* });
@richtr
richtr / handbrake_nas.applescript
Last active January 1, 2017 23:00
Synology NAS (or any other AFP-based shared folder) to Handbrake auto-conversion of avi/mkv files to mp4
-- AppleScript that mounts an AFP service (e.g. a Synology NAS Diskstation) then
-- searches for any .avi or .mkv files in the requested volume and converts all
-- the files it finds to .mp4 via HandbrakeCLI (which must be installed on your
-- machine at /Applications/HandbrakeCLI)
-- IMPORTANT: You may need to make sure your NAS does not sleep until ~4 hours of
-- inactivity has passed so it doesn't interrupt the mp4 conversion process of
-- this script.
-- Based loosely on the script published at http://cybernetnews.com/batch-convert-videos-handbrake-applescript/
@richtr
richtr / NormalVariablesFunctions.js
Last active August 29, 2015 13:59
Variable-bound Functions: JIT (Just In Time) function binding as an alternative to inline conditional statements within fast render loops
/**
*
* Normal method w/ inline conditional statements placed within each render loop
*
*/
var myVariable = true;
function normalLoop() {
if ( myVariable === true ) {
@richtr
richtr / broadcastwebsocket_basic_example.html
Last active August 29, 2015 13:57
BroadcastWebSocket: advertising, discovering and communicating between web pages and devices running in the current local network
<!DOCTYPE html>
<html>
<head>
<title>BroadcastWebSocket usage demo</title>
</head>
<body>
<h1>BroadcastWebSocket usage demo</h1>
<script>
@richtr
richtr / broadcastwebsocket_basic_example.html
Last active August 29, 2015 13:57
BroadcastWebSocket: advertising, discovering and communicating between web pages and devices running in the current local network
<!DOCTYPE html>
<html>
<head>
<title>BroadcastWebSocket usage demo</title>
</head>
<body>
<h1>BroadcastWebSocket usage demo</h1>
<script>
@richtr
richtr / advertiser.html
Last active August 29, 2015 13:57
BroadcastWebSocket (#1): Pure P2P advertisement, discovery and establishment of a full-duplex messaging channel between previously isolated web pages within a local network (updated strawman proposal can be found at https://gist.github.com/richtr/9683905)
<!DOCTYPE html>
<html>
<head>
<title>Pure P2P messaging channel establishment: Advertiser</title>
</head>
<body>
<h1>Pure P2P messaging channel establishment: Advertiser</h1>
<script>