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
@chitoku-k
chitoku-k / .travis.linux.yml
Last active September 2, 2022 06:33
ChromeDriver on Travis CI
os: linux
node_js: '12'
sudo: required
env: DISPLAY=':99.0'
dist: trusty
addons:
apt:
update: true
sources:
- google-chrome
@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>
@domenic
domenic / unabashed-monadic-promises.md
Last active December 17, 2015 15:29
Unabashed Monadic Promises on top of Q-Like Promises

Unabashed Monadic Promises on top of Q-Like Promises

Using the terminology from Mark Miller's "The Paradox of Partial Parametricity", this gist shows how you can build unabashed monadic promises on top of Q-like promises.

Problem Statement

Given:

Q: Ref<t> → Promise<t>
@brucelawson
brucelawson / native over web reasons
Last active December 15, 2015 23:09
Native app developers: what are your reasons for preferring to develop native over Web apps?
[My initial list:]
DRM
speed for superhi-perf games
app store placement
source-code secrecy
[list compiled from other people's twitter answers; thanks all!]
pushing native notifications when they're not in the "app" (several people said this)
@neilj
neilj / window-controller.js
Last active November 4, 2022 21:41
Cross-tab window controller
function WindowController () {
this.id = Math.random();
this.isMaster = false;
this.others = {};
window.addEventListener( 'storage', this, false );
window.addEventListener( 'unload', this, false );
this.broadcast( 'hello' );
@richtr
richtr / orientationChange.js
Last active February 26, 2021 09:11
JavaScript shim of iOS's window.orientation + orientationchange events for other (typically mobile) browsers
/*
* OrientationChange Event Shim
* http://github.com/richtr
*
* Copyright (c) 2012, Rich Tibbett
*
* 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
*