Skip to content

Instantly share code, notes, and snippets.

@twilight-sparkle-irl
twilight-sparkle-irl / pollview.js
Last active June 14, 2023 19:07
view poll percentages on tumblr (for pasting into JS console)
// get randomly generated string for react elements
var suffix = Object.keys(document.querySelector('#base-container'))[0].split('$')[1]
var reakt = (x)=>`__react${x+'$'+suffix}`
// get current clicked-on post (clicked on OP's url on the dashboard, or went to direct www.tumblr.com link)
var tlo = document.querySelector('[data-testid="timelinePosts"] [data-id]')[reakt`Fiber`].child.child.child.memoizedProps.timelineObject
var poll = tlo.content.filter(x=>x.type=='poll')[0] // get first poll in post
// grab the results for the poll
tumblr.apiFetch(`/v2/polls/${tlo.blogName}/${tlo.idString}/${poll.clientId}/results`).then(function (results) {
let output = []
@twilight-sparkle-irl
twilight-sparkle-irl / cohost-paste.user.js
Last active January 25, 2023 01:22
Image pasting userscript (click the Raw button with Tampermonkey or etc installed!)
// ==UserScript==
// @name Cohost imagepasting
// @version 0.3.1
// @description paste images in cohost
// @author Twilight
// @match https://cohost.org/*/post/compose*
// @match https://cohost.org/*/post/*/edit
// @icon https://cohost.org/static/a4f72033a674e35d4cc9.png
// @license MIT
// @grant none
@twilight-sparkle-irl
twilight-sparkle-irl / poll-unlocker.user.js
Last active February 5, 2023 05:46
unlock polls on tumblr (click the Raw button with Tampermonkey installed!)
// ==UserScript==
// @name Poll Unlocker
// @version 0.1
// @description gives u polls
// @author Twilight Sparkle
// @license MIT
// @match https://www.tumblr.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=tumblr.com
// @grant none
// @run-at document-start
/*
Copyright 2021 Andrew Sillers <apsillers@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
@twilight-sparkle-irl
twilight-sparkle-irl / bbcodifier.js
Created October 8, 2021 00:00
bbcode input keybind thingy (made for cytube but honestly who cares)
let binds_to_tags = {
'KeyB': 'b',
'KeyI': 'i',
'KeyU': 'u',
'KeyS': 's',
'KeyD': 'color',
'ArrowUp': 'sup',
'ArrowDown': 'sub',
'KeyK': 'spoiler',
}
@twilight-sparkle-irl
twilight-sparkle-irl / chirp.js
Created August 11, 2021 18:24
chirp font disabler
// @yourcompanionAI chirp font disabler script
// thanks to @adryd_ for the second decider
document.cookie="ab_decider=responsive_web_chirp_font_enabled=false&responsive_web_nav_visual_refresh_enabled=false"
@twilight-sparkle-irl
twilight-sparkle-irl / bot.py
Last active January 29, 2021 22:14
simple LiquidSoap Discord bot
import client
import discord
from discord.ext import commands
# TODO: Automatic updates on the statuses of tracks
# TODO: Make %info command make more sense and only let you view the status of requested tracks
# TODO: Make %queue and %info possible for non-DJs by ensuring safe commands — currently it's a security risk(?)
description = '''What's up, fresh meat. It's Vinyl Scratch, bringing you the tunes YOU want and letting you know what's under the needle.'''
bot = commands.Bot(command_prefix='%', description=description)
print("and 1")
@twilight-sparkle-irl
twilight-sparkle-irl / deadfish.js
Created January 16, 2021 06:58
deadfish implementation in __defineGetter__
// https://esolangs.org/wiki/Deadfish
$_ = function(e,v) {
var v = (v===undefined||v in {255:0,'-1':0})?0:v
var e = e===undefined?'':e
let x = {e:e,v:v}
x.__defineGetter__('i', ((a,b)=>(()=>$_(a,++b)))(e,v))
x.__defineGetter__('d', ((a,b)=>(()=>$_(a,--b)))(e,v))
x.__defineGetter__('s', ((a,b)=>(()=>$_(a,b*b)))(e,v))
x.__defineGetter__('o', ((a,b)=>(()=>$_(a+String.fromCodePoint(b),b)))(e,v))
@twilight-sparkle-irl
twilight-sparkle-irl / pinkiepie.js
Last active January 16, 2021 05:15
normal javascript for normal ponies
var x$jscomp$75 = [
'pIFcGSktW5OBqvtcPmoAW5bR',
'o2OhW5pcKSo+W74',
'AhpcGwz3WO4ypuBdTq',
'W4JcPSoRwxqUxJXHnLfK',
'b8kZCCoemctdSCkAoGy4WOW',
'WQNcMSkfAaGyW6ddImo1DG',
'aaFcIgnaWP/dHIdcUtG',
'WQJcGCoMnmkbqSoVW7b1WPSYe8oh',
'W7hdJ8k6DSoLvMm',
@twilight-sparkle-irl
twilight-sparkle-irl / main.cpp
Last active January 26, 2021 02:32
example of what an extremely barebones among us hook looks like (no graphics)
// use il2cppinspector to create a c++ scaffolding project
// import minhook
// replace user/main.cpp with this
// play around! this basically shows you how to hook any function you'd like
// it's obviously not at all what you'd call "complete", but it contains enough stuff i had to figure out through trial and error
#include "pch-il2cpp.h"
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#include <iostream>