Skip to content

Instantly share code, notes, and snippets.

View cuylerstuwe's full-sized avatar
Drinking covfefe.

Cuyler Stuwe cuylerstuwe

Drinking covfefe.
View GitHub Profile
// ==UserScript==
// @name Test for Event-Driven Web Controllers
// @namespace salembeats
// @version 1.51
// @description UPDATE: Genericized to respond well to an additional controller (Logitech F310), plus constructor, plus axes, plus nicknames.
// @author Cuyler Stuwe (salembeats)
// @include *
// @require https://gist.github.com/salembeats/98cd58cfcee694e3bbc08adc3d925080/raw/0a33ea4f15df76fc54163eb12e9674bc120beb64/event-driven-web-controllers-library.js
// @noframes
// ==/UserScript==
// Event-Driven Web Controllers Library
// Version: 1.6
// by Cuyler Stuwe (salembeats)
//
// Purpose:
//
// Simplify usage of responding to controller button change events, to utilize controllers as simple work productivity tools (where ease-of-use trumps performance).
//
// Instructions:
//
// ==UserScript==
// @name Perch Kitchen - No Means No
// @namespace salembeats
// @version 1.61
// @description .
// @author Cuyler Stuwe (salembeats)
// @include https://www.mturkcontent.com/dynamic/hit?*
// ==/UserScript==
const GIDS = [
// ==UserScript==
// @name Amazon Pay Withdrawal QoL
// @namespace salembeats
// @version 1.51
// @description UPDATE: Money formatting fix.
// @author Cuyler Stuwe (salembeats)
// @match https://payments.amazon.com/aes/withdrawals*
// @grant GM_setValue
// @grant GM_getValue
// @noframes
@cuylerstuwe
cuylerstuwe / mturk-vanilla-submit-on-enter-fragment.js
Last active June 26, 2019 21:36
A short Javascript fragment for quickly adding the most common "click-submit-on-enter" functionality to an mTurk userscript.
document.addEventListener("keyup", e => {
const {key} = e;
if(key === "Enter") {
e.preventDefault();
const submitButton = [
document.querySelector("#submitButton"),
document.querySelector("#SubmitButton"),
document.querySelector("[type='submit']")
].find(el => !!el);
el.click();
@cuylerstuwe
cuylerstuwe / forking-panda-express.user.js
Last active July 3, 2019 07:21
Hit Forker and Panda Crazy in a split shared tab.
// ==UserScript==
// @name Panda Express
// @namespace salembeats
// @version 1.3
// @description Puts Hit Forker (and variants) side-by-side with Panda Crazy. Also acts as a liason allowing Hit Forker and Panda Crazy to post/receive messages from one another by using window.parent as a proxy.
// @author Cuyler Stuwe (salembeats)
// @match https://worker.mturk.com/?pandaExpress*
// @grant none
// ==/UserScript==
// ==UserScript==
// @name Victoria "Good Substitute" Pix Clix
// @namespace salembeats
// @version 1
// @description .
// @author Cuyler Stuwe (salembeats)
// @include https://wml1.crowdcomputingsystems.com/workfusion/public/HTMLRenderer?submissionUUID=*
// @grant none
// ==/UserScript==
@cuylerstuwe
cuylerstuwe / remove-all-zip-files-with-matching-directory-names.md
Last active April 15, 2019 17:30
Remove All Zip Files With Matching Directory Names

Shell Script: "Remove All Zip Files With Matching Directory Names"

Problem:

Recently, I've used my Egghead Downloader userscript to download lots of lessons as ZIP files. I've done this from time to time, but haven't always gotten around to actually unzipping them. And sometimes, because the network device that serves them is relatively slow, I haven't stuck around for the unzipping process to finish in order to actually deleting the remaining ZIP files after extracting to folders with the same name.

Solution:

This is the quick cleanup script I wrote to solve the issue -- It will delete any zip file under the current directory whose name matches a directory name.

// ==UserScript==
// @name Quin Typespeak
// @namespace salembeats
// @version 1.4
// @description 1.4 -- Attempts at fixing.
// @author Cuyler Stuwe
// @include https://www.speedtypingonline.com/typing-test*
// @grant none
// ==/UserScript==
@cuylerstuwe
cuylerstuwe / nginxproxy.md
Created February 26, 2019 06:15 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers