Skip to content

Instantly share code, notes, and snippets.

View Hans5958's full-sized avatar
🏫
Uni and uni and uni and... (limited availability!)

Hans5958 Hans5958

🏫
Uni and uni and uni and... (limited availability!)
View GitHub Profile
@Hans5958
Hans5958 / extra-A-2.json
Created February 19, 2025 15:14
Few save data when trying Club Penguin Island (which I couldn't access anymore after restarting 😢)
{"UserName":"A","BreadCrumbs":{"breadcrumbs":[{"breadcrumbType":0,"id":"0"}]},"ClaimableRewards":{"ClimedRewards":[23,34]},"ConsumableInventory":{"Inventory":{}},"Equipment":{"Equipment":[{"equipmentId":-3545113412020191031,"dateTimeCreated":1739974071020,"definitionId":80,"parts":[{"slotIndex":8,"customizations":[{"type":1,"definitionId":5,"index":0,"scale":10,"uoffset":-0.1065876,"voffset":-0.1654857,"rotation":0,"repeat":false},{"type":1,"definitionId":25,"index":1,"scale":10,"uoffset":0.1428142,"voffset":-0.1059622,"rotation":0,"repeat":false}]}]},{"equipmentId":-6811150125261387441,"dateTimeCreated":1739974291306,"definitionId":352,"parts":[]},{"equipmentId":5622482265587076610,"dateTimeCreated":1739974291322,"definitionId":392,"parts":[]}]},"DailySpinData":{"EarnedRepeatableRewardIds":[],"EarnedNonRepeatableRewardIds":[],"NumSpinsSinceReceivedChest":0,"NumSpinsSinceReceivedExtraSpin":1,"TimeOfLastSpinInMilliseconds":1739974163482,"CurrentChestId":0,"NumPunchesOnCurrentChest":2,"NumChestsReceivedOfCurren
@Hans5958
Hans5958 / VocaDB Name Filler.js
Last active February 16, 2025 15:53
Fills VocaDB song name from the original version. Licensed under MIT. More info: https://gitlab.com/Hans5958-MWS/vocadb-docs/-/wikis/notes/web-scripts#name-filler
(async () => {
const sameElStr = "div.editor-field:nth-child(4) > table:nth-child(1) > tbody:nth-child(1)"
const valueEl = i => document.querySelector(sameElStr + `> tr:nth-child(${i}) > td:nth-child(2) > input:nth-child(1)`)
const keyEl = i => document.querySelector(sameElStr + `> tr:nth-child(${i}) > td:nth-child(1)`)
const choiceEl = i => document.querySelector(`div.editor-field:nth-child(2) > select:nth-child(1) > option:nth-child(${i})`)
const originalId = document.querySelector("a.btn-nomargin:nth-child(1)").href.split("S/")[1]
const data = sessionStorage.getItem ? JSON.parse(sessionStorage.getItem("cache_orig_" + originalId)) : await fetch("//" + location.host + "/api/songs/" + originalId + "/for-edit").then((response) => response.json())
sessionStorage.setItem("cache_orig_" + originalId, JSON.stringify(data))
allVideos = [...document.querySelectorAll('ytd-playlist-video-renderer')]
videosToRemove = allVideos.filter(current => {
const videoLink = current.querySelector("#video-title").href.split("&")[0].split("?")[1]
const foundElements = allVideos.filter(el => el.querySelector(`a[href*="${videoLink}"]`))
return foundElements[1] === current
})
console.log(videosToRemove.length)
;(async () => {
[...document.querySelectorAll('#anchor-watch-on-yt')].map(el => el.href.split('=')[1]).join('\r\n')
// reversed
[...document.querySelectorAll('#anchor-watch-on-yt')].map(el => el.href.split('=')[1]).reverse().join('\r\n')
@Hans5958
Hans5958 / proof.md
Last active August 20, 2024 00:50
Keyoxide proof, using the Keybase format, changed slightly

Keyoxide proof

I hereby claim:

  • I am Hans5958 on GitHub.
  • I am Hans5958 (aspe:keyoxide.org:DSEBK7DQQNRHNOQQBZM65AFYC4) on Keyoxide.

And finally, I am proving ownership of the GitHub account by posting this as a gist.

My publicly-auditable identity:

@Hans5958
Hans5958 / _techinfo-bmcb-2408.md
Last active December 7, 2024 17:42
Information regarding Black MIDI Comparison Block (August 2024 - Temp. Office PC Edition)
Next
Timeline of Black MIDI Comparison Block
◀️ Previous
@Hans5958
Hans5958 / _techinfo-bmcb-2407.md
Last active August 14, 2024 06:06
Information regarding Black MIDI Comparison Block (July 2024)
Next
Timeline of Black MIDI Comparison Block
◀️ Previous
@Hans5958
Hans5958 / TouhouDB Reverse Search Bookmarklet.txt
Last active February 16, 2025 15:54
Simple script to find VocaDB/TouhouDB/UtaiteDB entries from URLs; a reverse search tool. Licensed under MIT.
javascript:fetch('https://touhoudb.com/api/songs/findDuplicate?pv[]='+document.location).then((t=>t.json())).then((t=>{t.matches.length>0&&(document.location='https://touhoudb.com/S/'+t.matches[0].entry.id)}));
@Hans5958
Hans5958 / Google Drive PDF Ripper._.md
Last active February 26, 2025 08:05 — forked from dpaluy/README.md
Google Drive PDF Ripper: Rips (protected/view-only) PDFs from Google Drive

Google Drive PDF Ripper

This script rips (protected/view-only) PDFs from Google Drive by copying all the page images provided by Google Drive, and then put it on a PDF. It is a ripper (not a downloader) because it does not download the PDF file directly, and it involves some sort of conversion (PDF > images > PDF).

This script is based on https://gist.github.com/dpaluy/74258794f7930401cc27262e0ea794dd and https://gist.github.com/cirippo/86edfbddc3125eb64ee4b2d8faa52caa, with updates made since I was quite bored, and didn't want to adjust parts of the code to my own when I'm using it.

Features

  • Uses latest jsPDF version and modern JavaScript techniques
  • Supports Trusted Types API (for Google Chrome/Chromium users)
@Hans5958
Hans5958 / chalk-template to chalk.md
Created February 22, 2024 13:11
Converting from chalk-template to chalk with replace-all feature.
  1. Convert from template literal format.

    Find: chalk`(.*)\{([a-z]+) (.+)\}
    Replace: $1${chalk.$2(`$3`)}
    sed syntax: s/chalk`(.*)\{([a-z]+) (.+)\}/$1${chalk.$2(`$3`)}/g

  2. Convert chalk.foo(`${bar}`) to chalk.foo(bar).

    Find: \(`\$\{([^`{}]+)\}`\)
    Replace: ($1)