Skip to content

Instantly share code, notes, and snippets.

View okj579's full-sized avatar

Owen Kieffer-Jones okj579

View GitHub Profile
// ==UserScript==
// @name WWCD Now Playing Notifications
// @match *://cd101.com/stream-player/index.php
// @match *://cd1025.com/stream-player/index.php
// @match *://cd929fm.com/stream-player/index.php
// @grant none
// ==/UserScript==
(function() {
'use strict';
@okj579
okj579 / ctrl-s-submit.user.js
Last active September 17, 2020 15:05
Submits forms on Ctrl+S instead of trying to save as HTML
// ==UserScript==
// @name Submit on Ctrl+S
// @description Submits forms on Ctrl+S instead of trying to save as HTML
// @version 0.3.1
// @downloadURL https://raw.githubusercontent.com/imosnet/userscripts/master/submit-on-ctrl-s.user.js
// @author okj579
// @match *://*/*
// @grant none
// ==/UserScript==
// ==UserScript==
// @name Imos Page Timer
// @namespace tag://imos
// @description Ein Timer der anzeigt wie lange man sich auf der aktuellen Redmine/OTRS Seite befindet.
// @author Endlessdeath, okj579
// @match *://kunden.redmine.imos.net/*
// @match *://intern.redmine.imos.net/*
// @match *://otrs.hq.imos.net/*
// @version 2.1.1
// @downloadURL https://raw.githubusercontent.com/imosnet/userscripts/master/imos-page-timer.user.js
@okj579
okj579 / mdn-ifl.user.js
Last active September 17, 2020 14:38
MDN I'm Feeling Lucky
// ==UserScript==
// @name MDN I'm feeling lucky
// @author okj579
// @version 2.0.1
// @description Redirects you from the search page to the first result if it matches your query exactly (or with '..' instead of '.prototype.')
// @downloadURL https://raw.githubusercontent.com/imosnet/userscripts/master/mdn-im-feeling-lucky.user.js
// @match https://developer.mozilla.org/*/search?*
// @icon https://www.google.com/s2/favicons?domain=developer.mozilla.org
// @grant none
// ==/UserScript==
@okj579
okj579 / initial-hover.js
Last active February 26, 2019 08:27
Initial Hover
(function initialHover(window, elements, cssClass, firstEvent, finished) {
window.addEventListener('mousemove', update);
window.addEventListener('mouseover', update);
window.addEventListener('load', finish);
function update(e) {
console.log('update');
if (
(e.sourceCapabilities && e.sourceCapabilities.firesTouchEvents) ||
(firstEvent && distance(firstEvent, e) > 50)
(function recaptcha(){
var $forms = $('form.recaptcha-enabled');
if (!$forms.length) return;
var tokenUpdater = new RecaptchaTokenUpdater(cdata.RECAPTCHA_SITE_KEY);
$forms.each(function(){
var $form = $(this),
$input = $('<input type="hidden" name="g-recaptcha-response">').appendTo($form);
<?php
function ansiColor($color, $text) {
static $colorDict;
if (!$colorDict) {
$colorDict = array_flip(['black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white']);
}
$colorVals = [];
foreach ((array)$color as $i => $name) {
$colorVals[$i] = $i ? 40 : 30;
if (substr_compare($name, 'bright', 0, 6) === 0) {
// ==UserScript==
// @name Imos Redmine Wiedervorlage überfällig
// @match *://*.redmine.imos.net/*
// @icon https://kunden.redmine.imos.net/favicon.ico
// @version 2.1.1
// @downloadURL https://raw.githubusercontent.com/imosnet/userscripts/master/redmine-overdue.user.js
// @grant none
// ==/UserScript==
jQuery(function($) {
@okj579
okj579 / load-without-require.js
Created October 4, 2018 09:45
Loads a script which should ignore RequireJS define()
!function a(b,c){return window.jQuery?$.get(b,function(d){new Function('define',d)(),c&&c()},'text'):setTimeout(function(){a(b,c)},1)}(
'js/url.js',
function() {
// onload script
}
);
@okj579
okj579 / cookie.js
Last active July 8, 2020 07:34
Code-golfed (240B) cookie library