Skip to content

Instantly share code, notes, and snippets.

Avatar

Rich Tibbett richtr

View GitHub Profile
@richtr
richtr / config.yml
Last active Nov 28, 2017
Parse YAML from bash with sed and awk.
View config.yml
development:
adapter: mysql2
encoding: utf8
database: my_database
username: root
password:
apt:
- somepackage
- anotherpackage
@richtr
richtr / blockstack-verification.txt
Created Feb 10, 2017
Verifying that "richtr.id" is my Blockstack ID. https://onename.com/richtr
View blockstack-verification.txt
Verifying that "richtr.id" is my Blockstack ID. https://onename.com/richtr
@richtr
richtr / logo_mediasession
Created Jun 30, 2015
Media Session Logo
View logo_mediasession
<?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 Aug 29, 2015
General considerations for Media Focus scoping, lifecycle and events
View gist:2235fdae25c74186297d

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 Sep 23, 2014
A reliable DeviceOrientation and DeviceMotion Events API feature detection library
View SensorCheck.js
/**
* 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 Jan 1, 2017
Synology NAS (or any other AFP-based shared folder) to Handbrake auto-conversion of avi/mkv files to mp4
View handbrake_nas.applescript
-- 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 Aug 29, 2015
Variable-bound Functions: JIT (Just In Time) function binding as an alternative to inline conditional statements within fast render loops
View NormalVariablesFunctions.js
/**
*
* 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 Aug 29, 2015
BroadcastWebSocket: advertising, discovering and communicating between web pages and devices running in the current local network
View broadcastwebsocket_basic_example.html
<!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 Aug 29, 2015
BroadcastWebSocket: advertising, discovering and communicating between web pages and devices running in the current local network
View broadcastwebsocket_basic_example.html
<!DOCTYPE html>
<html>
<head>
<title>BroadcastWebSocket usage demo</title>
</head>
<body>
<h1>BroadcastWebSocket usage demo</h1>
<script>
@richtr
richtr / advertiser.html
Last active Aug 29, 2015
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)
View advertiser.html
<!DOCTYPE html>
<html>
<head>
<title>Pure P2P messaging channel establishment: Advertiser</title>
</head>
<body>
<h1>Pure P2P messaging channel establishment: Advertiser</h1>
<script>