Skip to content

Instantly share code, notes, and snippets.

View plusreed's full-sized avatar

Reed plusreed

View GitHub Profile
@plusreed
plusreed / social_media.php
Created December 18, 2022 19:09
Twitter-compliant social media link aggregator
<?php
$social_media = [
'Instagram' => 'https://www.instagram.com/username/',
'Facebook' => 'https://www.facebook.com/username/',
];
function request_from_twitter() {
return !(strpos($_SERVER['HTTP_REFERER'], 'twitter.com')
|| strpos($_SERVER['HTTP_REFERER'], 't.co'));
}
@plusreed
plusreed / upload_script.py
Last active November 28, 2022 04:29
Upload a transparent Twitter profile picture
# You'll need Tweepy and a Twitter dev account.
# Your image should, preferably, be under 1000 pixels on either dimension (width and height.)
# Should also be under 700KB.
# This script is very hit-or-miss. GLHF.
from tweepy import OAuth1UserHandler, API
APIKEY = ""
APIKEYSECRET = ""
@plusreed
plusreed / pipis.js
Last active September 18, 2022 17:51
Spamton Sweepstakes Monitor
// Super rudimentary monitor for the spamton sweepstakes. Code is very ugly but works.
// Run with Node: `node pipis.js`
// You can change the interval by passing a seconds value: `node pipis.js 5`
// This will make it check every 5 seconds instead of every 10 seconds (default.)
const ENDPOINT = "https://spamton-prizes.fangamer.workers.dev/"
let last = null
async function main() {
// headers added to mask automated requests from pipis
const res = await fetch(ENDPOINT, {
@plusreed
plusreed / tabellarius.md
Last active September 18, 2022 02:46
Tabellarius

🤔

Server implementation is here: plusreed/tabellarius-api

Server -> Client

  • updateTimings
    • Seeds Tabellarius clients with merch message backlog, queue length, live duration (how long WAN has been going on), whether the queue is paused or not, the marquee text and whether it should be displayed or not, queue duration and next merch message timing.
  • sponsorList
    • Updates all Tabellarius clients with a sponsor list.
  • Body is of type Sponsor[].
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/Users/reed/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
@plusreed
plusreed / reddit_profile_pics
Last active February 18, 2020 03:16
Get all the Reddit default profile pictures.
#!/bin/bash
## Gets all the default Reddit profile pictures.
## https://www.reddit.com/user/timawesomeness/comments/813jpq/default_reddit_profile_pictures/
## This script is licensed under the MIT license, but the assets downloaded are the property of Reddit Inc.
ALL_COLOR="A5A4A4 545452 A06A42 C18D42 FF4500 FF8717 FFB000 FFD635 DDBD37 D4E815 94E044 46A508 46D160 0DD3BB 25B79F 008985 24A0ED 0079D3 7193FF 4856A3 7E53C1 FF66AC DB0064 EA0027 FF585B"
for i in $ALL_COLOR; do
wget https://www.redditstatic.com/avatars/avatar_default_{01,02,03,04,05,06,07,08,09}_$i.png
@plusreed
plusreed / mtpc.sh
Created June 15, 2018 04:05
Check how many connections you have to your MTProxy server.
#!/bin/bash
PORT=941
if [ "$EUID" -ne 0 ]
then echo "Please run me as root or with sudo"
exit
fi
netstat -anp | grep ":${!PORT}" | grep "ESTABLISHED" | echo "Current MTProxy connections: $(wc -l)"
{
"active": true,
"atCapacity": false,
"showId": 2937,
"showType": "hq",
"startTime": "2018-01-26T02:00:00.000Z",
"nextShowTime": null,
"nextShowPrize": null,
"upcoming": [
{