Skip to content

Instantly share code, notes, and snippets.

View mjschranz's full-sized avatar

Matthew Schranz mjschranz

  • Toronto, Ontario
View GitHub Profile
@mjschranz
mjschranz / netflixAutoPlay
Last active August 29, 2015 14:11
Netflix Auto Resume Browser
setInterval(function() {
var resumeButtons = document.querySelectorAll("button.button.continue-playing");
// Sadly no unique identifiers on each button for continue/restart/stop
// Only real way is to look for strings inside, but if all you want to do
// is auto continue, this will suffice until HTML layout changes
// Obviously, open your console and run this while you have a video stream running.
// Admittedly I have NOT tested this in the event of this popup appearing after a
// new video has started so unsure if pages are reloaded or not.
@mjschranz
mjschranz / knifemontage.txt
Last active August 29, 2015 14:05
Knife montage timers Gassy Mexican
#7
- 6:47
#8
- 10:17
#13
- 10:50
#17
widget = new YT.UploadWidget( "video-container", {
width: "100%",
height: "69%",
events: {
"onApiReady": function() {
widget.setVideoKeywords([ "webcam", "video", "popcorn" ]);
widget.setVideoPrivacy( "unlisted" );
},
"onUploadSuccess": function() {
_progress.classList.remove( "hidden" );
@mjschranz
mjschranz / index.html
Created July 26, 2012 16:29
new popcorn runner
<!DOCTYPE html>
<html>
<head>
<title>Popcorn Test Suite Runner</title>
<link rel="stylesheet" href="qunit/qunit.css" type="text/css" media="screen">
<link rel="stylesheet" href="popcorn.testrunner.css" type="text/css" >
<script src="jquery.js"></script>
<script src="popcorn.testrunner.js"></script>
<script>
document.addEventListener( "DOMContentLoaded", function() {
@mjschranz
mjschranz / gist:3100092
Created July 12, 2012 18:47
Export Button Tests
import unittest
import time
from selenium import webdriver
from selenium.webdriver import ActionChains
from selenium.webdriver.common.keys import Keys
from selenium.common.exceptions import NoSuchElementException
class PM_HeaderTests(unittest.TestCase):
def setUp(self):
document.addEventListener( "DOMContentLoaded", function() {
var _butter,
_iframe,
_media;
function startTests() {
asyncTest( "Media - Remove Track", function() {
var tracks = _media.tracks;
_butter.listen( "trackremoved", function() {
ok( true, "DERP" );
@mjschranz
mjschranz / gist:3004993
Created June 27, 2012 15:53
Page Tests
/*global text,expect,ok,module,notEqual,Butter,test,window*/
(function (window, document, Butter, undefined) {
require( [ "../src/core/page", "../src/core/config", "../src/dependencies" ],
function( Page, Config, Dependencies ) {
var _config = Config.parse( '{ "test": "derp" }' ),
_loader = Dependencies( _config ),
_page = new Page( _loader, _config );
test( "Page - scrape media target and media elements", 3, function() {
css: function( url, exclude, callback, checkFn, error ){
var scriptElement,
interval;
checkFn = checkFn || function(){
return !!scriptElement;
};
function runCheckFn() {
interval = setInterval( function(){
@mjschranz
mjschranz / CSS Loader
Created May 17, 2012 19:47
Butter CSS Loader
var scriptElement,
interval;
checkFn = checkFn || function(){
return !!scriptElement;
};
function runCheckFn() {
interval = setInterval(function(){
if( checkFn() ){
@mjschranz
mjschranz / Huh?
Created May 16, 2012 22:00
Something
css: function( url, exclude, callback, checkFn ){
var scriptElement;
checkFn = checkFn || function(){
return !!scriptElement;
};
url = fixUrl( url );
if( !checkFn() ){
scriptElement = document.createElement( "link" );