Skip to content

Instantly share code, notes, and snippets.

View twilight-sparkle-irl's full-sized avatar
:shipit:
:shipit::shipit::shipit::shipit::shipit::shipit::shipit::shipit::shipit::shipit:

twilight sparkle twilight-sparkle-irl

:shipit:
:shipit::shipit::shipit::shipit::shipit::shipit::shipit::shipit::shipit::shipit:
View GitHub Profile
@twilight-sparkle-irl
twilight-sparkle-irl / InvokeWDT.ps1
Created November 2, 2018 03:24
invoke-windowsdefendertoast
Function Invoke-WindowsDefenderToast {
Param (
[Parameter(Mandatory=$True)]
[string]$Message,
[Parameter()]
[string]$Title="Virus & threat protection"
)
[Windows.UI.Notifications.ToastNotificationManager, Windows.UI.Notifications, ContentType = WindowsRuntime]
[xml]$ToastTemplate = @"
<toast launch="app-defined-string">
@twilight-sparkle-irl
twilight-sparkle-irl / FakeScreen.ps1
Created November 6, 2018 16:43
make a fake smartscreen/update-like popup
$Title = "Windows needs your help"
$Content = @"
All we need is your credit card number, the three digits on the back, and the expiration month and day! But be quick!
Sphinx of black quartz, judge my brown fox over this lazy dog!
Testing testing testing
"@
$ButtonText = "Accept"
# -- code begins below, scroll down till you see "ACCEPT CODE" to edit what happens when you accept
@twilight-sparkle-irl
twilight-sparkle-irl / jazzpunk.md
Last active March 8, 2026 00:46
jazzpunk console commands

Jazzpunk Console Commands

  • exit / quit
    Exit the console.

  • iddqd / godmode
    Turn on/off godmode.

  • athiestmode
    Turn off godmode.

@twilight-sparkle-irl
twilight-sparkle-irl / smb3.htm
Created January 31, 2019 22:42
a broken smb3 castle scene maker thingy
<!DOCTYPE html>
<!--
credit to bootsy (@NO_BOOT_DEVICE)
-->
<html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>smb3.htm</title>
<style type="text/css">
:root,body {
background-color: black;
@twilight-sparkle-irl
twilight-sparkle-irl / swipernoswiping.csv
Last active March 8, 2026 00:09
a guide to twitter video download bots
id username
997774805511360512 this_vid
1074360508030074880 thisvid_
1078893871780847618 this_vid_
708564331332444160 GetVideoBot
1010484773066887168 DownloaderBot
@twilight-sparkle-irl
twilight-sparkle-irl / oof.lua
Last active February 4, 2019 15:46
makes mario oof randomly. a really, really simple test of lua stuff. probably glitchy.
memory.usememorydomain("RDRAM")
math.randomseed(os.time())
local oof = 0
local dew_it = 0
while true do
if math.random() > (0.994 - dew_it) and oof < 1 then
console.log(oof)
memory.write_u32_be(0x33b17c,0x00020460+math.random(0,5))
oof = 200
dew_it = 0
@twilight-sparkle-irl
twilight-sparkle-irl / rtpin.js
Last active March 8, 2026 00:09
pin retweets on twitter ----> ----> !! YOU NEED TO BE ON THE OLD LAYOUT, GET GoodTwitter !! <---- <----
$(document).ajaxComplete((e, x, o) => {
if (o.url == "https://api.twitter.com/1.1/statuses/retweet.json") {
tweet_id = JSON.parse(x.responseText)['id_str'];
auth_token = JSON.parse(document.querySelector('#init-data').value)['formAuthenticityToken'];
fetch("https://twitter.com/i/tweet/pin", {
body: `authenticity_token=${auth_token}&id=${tweet_id}`,
method: "POST",
headers: {
Accept: "application/json, text/javascript, */*; q=0.01",
"Cache-Control": "no-cache",
@twilight-sparkle-irl
twilight-sparkle-irl / fuckAprilFools.js
Last active March 8, 2026 00:07
reenable light theme
// i have no clue who the original source for this code was, but originally it enabled developer settings
// i've hacked it so that it sets light theme enabled, even when the april fools experiment is running.
// it might take a moment, but just click into Settings > Appearance and maybe toggle from light to dark to light if it's particularly slow
(async()=>{let r=await new Promise(r=>{let a=[[],{_:(a,b,c)=>r(c)},[["_"]]];typeof webpackJsonp==="object"?webpackJsonp.push(a):webpackJsonp(...a)});delete r.m["_"];delete r.c["_"];for(let i in r.c) {if(r.c.hasOwnProperty(i)){let m=r.c[i].exports;if(m&&(typeof(m)=="object")){if(("getExperimentId" in m)&&m.getExperimentId()==="2019-04_april_fools"){Object.defineProperty(r.c[i].exports,"inExperiment",{get:_=>false,set:_=>_,configurable:true})}else{if(("disableGamesTab" in m)){let g=m.getAllSettings();g.theme="light";m._actionHandlers.USER_SETTINGS_UPDATE({settings:g})}}}}}})()
// it's magic joel, it's magic
@twilight-sparkle-irl
twilight-sparkle-irl / style_to_obj.js
Last active March 8, 2026 00:07
an exercise in pain and suffering -- getting the set styles as an object from [element].style
// redundant_styles gets all the set styles, including ones that just set children value (text-decoration -> text-decoration-line, for example)
// implied_styles gets all the styles that are set and do not only affect the style by setting other properties
// all_styles gets all styles, unset or not. it's prety useless i just added it because it was possible
// getting the styles without the implied ones is not something i had time to do, it seems that i'd have to do text parsing to achieve that
style_to_obj = {}
if ('CSS2Properties'in window) { // firefox .style
style_to_obj['redundant_styles'] = (x=>Object.fromEntries(Object.keys((x.__proto__)).filter(_=>!_.match(/[A-Z]/g)).map(_=>[_,x.__lookupGetter__(_).bind(x)()]).filter(_=>_[1]!=='')))
style_to_obj['implied_styles'] = (x=>Object.fromEntries([...x].map(_=>[_,x[_]])))
@twilight-sparkle-irl
twilight-sparkle-irl / indexy.sh
Last active March 8, 2026 00:46
i went too deep. creates index files for a directory on the drive, and continually updates them
#!/bin/bash
# requires inotify-tools and tree be installed
# --CONFIG--
INDEXDIR="$(pwd)" # change this to where you have the directory you want to index mounted
URL="https://generichost.example/~/person/assets" # change this to where the urls go
TITLE="stuff - %s" # %s represents the current directory
# below is the css to apply to the files. you can touch it if you wanna
# but i'd just recommend replacing the directory listing creator entirely lol