Skip to content

Instantly share code, notes, and snippets.

View joeyparrish's full-sized avatar

Joey Parrish joeyparrish

View GitHub Profile
@joeyparrish
joeyparrish / jasmine-retry.js
Created August 15, 2022 22:29
A function to shim Jasmine and automatically retry failed tests
function retryFailedTests(retries, millisecondsBetweenRetries, setTimeout) {
const originalSpecConstructor = jasmine.Spec;
jasmine.Spec = function(attrs) {
const spec = new originalSpecConstructor(attrs);
const originalTestFn = spec.queueableFn.fn;
// Handles both styles of async testing (Promises and done()) and returns a
// Promise. Wraps synchronous tests in a Promise, too.
const runOriginalTest = () => {
@joeyparrish
joeyparrish / find-all-contributors.sh
Last active November 11, 2020 01:18
Shaka T-Shirt Raffle Code
#!/bin/bash
# Find all contributors to date. These users will get increased odds of winning
# in the raffle.
# These repos will be checked to list all contributors.
REPOS="shaka-player shaka-packager shaka-streamer shaka-player-embedded"
API_URL="https://api.github.com/repos/"
# 4 pages of data covers all PRs to date in all repos. Some pages will be empty
@joeyparrish
joeyparrish / demuxed-plus-plus.js
Last active October 28, 2020 19:35
Demuxed 2020 enhancements
// Instructions:
//
// 1. Tune in to Demuxed 2020
// 2. Open your JS console
// 3. Move to the context of the iframe called "conf"
// 4. Check that document.querySelector('video') returns something,
// and if not, go back to step 3
// 5. Copy and paste all this mess into your JS console
// 6. You now have playback rate and skip controls
//
@joeyparrish
joeyparrish / index.html
Created April 17, 2015 16:12
Demo of MSE bug in Chrome (http://crbug.com/478151)
<script src="mse_bug.js"></script>