Skip to content

Instantly share code, notes, and snippets.

View oxguy3's full-sized avatar

Hayden Schiff oxguy3

View GitHub Profile
@oxguy3
oxguy3 / coebot.tv notes - how to identify mods.md
Last active June 23, 2016 18:20
scratch notes about how I'm going to detect who is/isn't a mod for the website's control panel

So I want to add a control panel to CoeBot. The big problem is that Twitch does not have a good API for finding out if some is/isn't a moderator. There's this TMI endpoint, but that will only list moderators who are currently in chat, which is not ideal.

Someone else with the same problem as me wrote a bit of PHP that actually logs into IRC, runs the "/mods" command, and parses Twitch's response to get the mod list. I think I'm gonna go ahead and use this code. However, the problem is that logging into IRC is very slow, so I have to very carefully limit how often I do that. If I do it too much, it will result in a) slow loading times and therefore b) a very exploitable DDoS vulnerability.

Here's my plan: by default, the website will assume that the logged-in user is not a moderator in any channel. If the user tries to go to the "settings" page, it'll have a message something l

@oxguy3
oxguy3 / zeldathonhack.php
Created June 23, 2016 02:17
a hastily made workaround for zeldathon mods while coebot is refusing to answer their commands
<?php
require_once("common.php");
requireLoggedIn();
if (!in_array($_SESSION['channel'], array("itsoxguy3", "supermcgamer", "endsgamer", "0rganics", "1862011", "22angel35", "360chrism", "8bitbrigadier", "ainkayes", "animejessica", "aubis2", "avvvee", "awildabra", "axlrosie", "bbaass_tmh", "blip", "bluehairirl", "bomb_mask", "bushelofchewygoodness", "carlsagan42", "choco", "clarelms", "coebot", "dansalvato", "dewtroid", "diredwarf", "endsgamer", "erythsea", "fakearcticlght", "fakearcticlight", "femtastic", "frosty10001", "fuzzy_wolf", "gaspra_", "greatscottlp", "hewhoamareismyself", "insaneintherain", "jacksonparodi", "jamesrct", "jb2448", "jellybeee", "johnmackay13", "jyggy11", "kampydk", "legosjedi", "letsnarvik", "lindsaypez", "lizerdoo", "lucarimew", "marishkabob", "metalninjawolf", "mika_w", "mistress_fi", "mojmann", "narcissawright", "nathan_eel", "nytsura", "oc1_", "ortholabs", "pauseunpause", "pkmnnerdfighter", "poodleskirtfanclub", "poptartgamer", "ppeach2010", "princeofcosmos", "purplesteph", "rev
@oxguy3
oxguy3 / embiggener.js
Last active March 13, 2024 05:44
Greasemonkey script to find the biggest version of an image on a variety of sites
// ==UserScript==
// @name Embiggener
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Finds the biggest possible version of any image
// @author Hayden Schiff (oxguy3)
// @match *://*/*
// @grant unsafeWindow
// ==/UserScript==
@oxguy3
oxguy3 / opt-out.md
Last active June 16, 2016 18:25
Remove annoying crap from your life.
@oxguy3
oxguy3 / my old blog theme.html
Created June 10, 2016 21:26
the old theme for my tumblr blog
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="Description" content="{MetaDescription}" />
<title>{block:SearchPage}{lang:Search results for SearchQuery} - {/block:SearchPage}{block:PostTitle}{PostTitle} - {/block:PostTitle}{Title}</title>
<link rel="shortcut icon" href="{Favicon}" />
<link rel="apple-touch-icon" href="{PortraitURL-128}"/>
<link rel="alternate" type="application/rss+xml" href="{RSS}" />
@oxguy3
oxguy3 / adblock_whitelist.txt
Last active March 3, 2017 00:35
whitelist for my adblocker
192.168.1.32
about-scheme
achievementhunter.com
adf.ly
analytics.google.com
app.plex.tv
arstechnica.com
asdf.com
askubuntu.com
bandcamp.com
@oxguy3
oxguy3 / watchlist.enwiki.txt
Last active September 1, 2017 00:47
My English Wikipedia watchlist (backed up here just in case)
2017 FC Cincinnati season
ASafaWeb
Alan Koch (soccer)
Atlantic Coast Conference Men's Soccer Offensive Player of the Year
Butler County OH
CSP Industries
Camp Camp
Carl H. Linder III
Carl H. Lindner III
Carl Henry Linder III
@oxguy3
oxguy3 / RoughScroll.js
Last active September 27, 2023 15:02
Greasemonkey script for disabling smooth scrolling across the web (WIP! currently breaks a few websites, unfortunately)
// ==UserScript==
// @name RoughScroll
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Disables smooth scrolling on ALL websites
// @author Hayden Schiff (oxguy3)
// @match *://*/*
// @grant none
// ==/UserScript==
/* jshint -W097 */
@oxguy3
oxguy3 / figlol.sh
Last active February 24, 2016 03:15
bash script for giant animated rainbow text in your terminal
# Run `figlol <your message...>` to start it. To stop, mash ^C til it terminates, then run `unfiglol` to clean up.
# It's sorta derpy on some terminal window sizes; you might need to adjust it.
# Requires figlet (`brew/yum/dnf/apt-get install figlet`) and lolcat (`gem install lolcat`)
figlol() {
echo $@ | figlet -w `tput cols` -c -f doh > /tmp/figlol.txt;
clear;
tput civis;
i=1;
while true; do
@oxguy3
oxguy3 / miscellaneous_cleanup.css
Last active March 1, 2019 16:26
A master stylesheet for fixing little frustrations all over the web. Import to your browser with the Stylus extension.
/**
* Strike out links to certain websites to avoid accidentally visiting them.
*/
a[href*="//forbes.com"], a[data-href*="//forbes.com"], a[data-full-url*="//forbes.com"],
a[href*="//www.forbes.com"], a[data-href*="//www.forbes.com"], a[data-full-url*="//www.forbes.com"],
a[href*="//onforb.es"], a[data-href*="//onforb.es"], a[data-full-url*="//onforb.es"],
a[href*="//bizjournals.com"], a[data-href*="//bizjournals.com"], a[data-full-url*="//bizjournals.com"],
a[href*="//www.bizjournals.com"], a[data-href*="//www.bizjournals.com"], a[data-full-url*="//www.bizjournals.com"],
a[href*="//wired.com"], a[data-href*="//wired.com"], a[data-full-url*="//wired.com"],
a[href*="//www.wired.com"], a[data-href*="//www.wired.com"], a[data-full-url*="//www.wired.com"],