Skip to content

Instantly share code, notes, and snippets.

View supahgreg's full-sized avatar

Greg supahgreg

  • United States
View GitHub Profile
@supahgreg
supahgreg / GM_cryptoHash Tests
Created November 30, 2010 04:56
testing GM_cryptoHash
// ==UserScript==
// @id [email protected]
// @name Crypto Hash Tests
// @namespace phob.net
// @description testing GM_cryptoHash
// @include http://phob.net/*
// @include http://*.phob.net/*
// ==/UserScript==
/* case 1: no arguments */
@supahgreg
supahgreg / YouTube Enhancer - Scriptish test.user.js
Created November 30, 2010 16:51
shows (typeof ytplayer.getPlayerState) == undefined
// ==UserScript==
// @name YouTube Enhancer - Scriptish test
// @include http://youtube.*/*
// @include http://*.youtube.*/*
// @include https://youtube.*/*
// @include https://*.youtube.*/*
// ==/UserScript==
var ytplayer = unsafeWindow.document.getElementById("movie_player");
if (!ytplayer) {
@supahgreg
supahgreg / [email protected]
Created March 12, 2011 18:24
testing GM_(register|unregister|enable|disable)MenuCommand
// ==UserScript==
// @id [email protected]
// @name Scriptish menu command test!
// @author Greg Parris
// @namespace http://phob.net
// @description testing GM_(register|unregister|enable|disable)MenuCommand
// @include http://phob.net/
// ==/UserScript==
var body = document.getElementsByTagName("body")[0];
setting update.uso.lastFetch
done setting update.uso.lastFetch
checking if any scripts are from USO
8: [email protected] is a USO script
TIMEOUT TIMEOUT TIMEOUT!!! delay is: 800 (typeof: number)
5: [email protected] is a USO script
TIMEOUT TIMEOUT TIMEOUT!!! delay is: 500 (typeof: number)
// ==UserScript==
// @id BoerseFFm
// @name BoerseFFm
// @namespace tests
// @description checking the time changing
// @include http://www.boerse-frankfurt.de/DE/index.aspx?pageID=1
// ==/UserScript==
var clock = document.getElementById("clock");
var h, m, s, time;
@supahgreg
supahgreg / [email protected]
Created April 9, 2011 20:46
GM_setValue return test
// ==UserScript==
// @id [email protected]
// @name GM_setValue return test
// @namespace http://phob.net
// @description GM_setValue return test
// @include http://phob.net/*
// ==/UserScript==
GM_log("Setting scriptval 'isGood' to true");
var val = GM_setValue("isGood", true);
@supahgreg
supahgreg / githubYourForkSwitcher.user.js
Created July 16, 2011 14:25 — forked from erikvold/githubYourForkSwitcher.user.js
This userscript will make the ux of switching from your fork to the parent project much better, because you won't be taken to the root of the project when you switch, but instead you will be taken to the same page on the other repo.
// ==UserScript==
// @name GitHub Your Fork Switcher
// @namespace githubYourForkSwitcher
// @include http*://github.com/*/*
// @datecreated 2010-06-02
// @lastupdated 2011-07-16
// @version 0.3
// @author Erik Vergobbi Vold
// @contributor Greg Parris
// @license GPL version 3 or any later version; http://www.gnu.org/copyleft/gpl.html
@supahgreg
supahgreg / [email protected]
Created August 3, 2011 15:31
Press escape to close Quake Live's Game Summary, Live Game Info and notification popups
// ==UserScript==
// @id [email protected]
// @name Quake Live Escaper
// @version 1.6
// @namespace phob.net
// @author wn
// @description Press escape to close Quake Live's Game Summary, Live Game Info and notification popups
// @include http://*.quakelive.com/*
// @exclude http://*.quakelive.com/forum*
// @run-at document-end
@supahgreg
supahgreg / codereview.md
Created August 25, 2011 15:46 — forked from addyosmani/codereview.md
Lessons from a JavaScript code review

#Lessons From A JavaScript Code Review

I was recently asked to review some code and thought I might share some of the feedback I provided as it includes a mention of JavaScript fundamentals that are always useful to bear in mind.

####Problem: Functions to be used as callbacks (as well as objects) are passed as parameters to other functions without any type validation.

Feedback: For functions, at minimum 1) test to ensure the callback exists and 2) do a typeof check to avoid issues with the app attempting to execute input which may not in fact be a valid function at all.

if (callback && typeof(callback) === "function"){
@supahgreg
supahgreg / [email protected]
Created September 5, 2011 01:02
Testing GM_watchValue and GM_unwatchValue
// ==UserScript==
// @id [email protected]
// @name GM_watchValue test
// @version 1.0
// @namespace phob.net
// @author wn
// @description Testing GM_watchValue and GM_unwatchValue
// @include http://phob.net/
// @run-at document-end
// ==/UserScript==