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 / Google Drive PDF Ripper._.md
Last active April 26, 2024 05:30 — 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)

@Hans5958
Hans5958 / A DeviantArt Literature Thing.md
Last active November 27, 2023 14:31
This is a literature from the website DeviantArt (and also one other website). Try to find the original source, it is pretty easy.

This is a literature from the website DeviantArt (and also one other website). I did this because, it is quite long, quite weird, and he did it as a story for his art. Also, I just want to share it. All of the details have been stripped, hopefully.

Try to find the original source. This literature is SFW, I swear!

Part 1

"Ah, what a wonderful day!"

The female character happily murmered to herself as she strolled through the woods. Ah, just ambling through without a care in the world... what more could a [species] want?

Assalamualaikum warahmatullahi wabarakatuh.

Ada yang mengatakan bahwa komunis di negara lain sudah tidak eksis lagi, jadi dia juga mungkin beranggapan di Indonesia tidak eksis lagi. Matamu picek. Justru kewaspadaan perlu diterapkan sedini mungkin. Matamu picek! Matamu picek. Jangan selalu bilang ke negara lain tidak eksis lagi.

Justru harus kamu jaga di negara ini jangan sampai penghianatan itu kembali lagi di Indonesia. Ingat, darah keturunan PKI akan tetap mengalir kepada anak cucunya dia akan tetap menjadi penghianat. Bohong kalau tidak kamu. Picek yang mengatakan bahwa [di] negara lain tidak eksis lagi. Picek! Picek! Matamu picek!

Wassalamualaikum warohmatullohi wabarokatuh.

@Hans5958
Hans5958 / _techinfo.md
Last active September 7, 2023 13:43
Notes regarding Black MIDI Comparison Block (September 2023)

Video Source: Piano From Above v1.1.0 (with WinMMWRP), Open Broadcaster Software (OBS) v29.1.3
Audio Source: OmniMIDI v14.8.4 (1024 voices)
Soundfont: Choomaypiano.sf2

Specifications (Acer Nitro 5 AN515-57):

CPU: Intel Core i7-11800H @ 2.3 GHz (no overclock)
RAM: 16 GB DDR4 SDRAM @ 3200 MHz (15.8 GB total, dynamic virtual memory)
Storage: 512 GB NVMe SSD
GPU: NVIDIA GeForce RTX 3060 Laptop GPU

Jail and Unjail Custom Command on Dyno

This is a jail and unjail command that I made on my spare time. This is made for easier and faster response, along with a better way to jail someone on the phone.

Please note that the bot doesn't know if you jailed a right person, so please double check. Well, you can remove {silent} so you know if it's a success, but it won't be seamless.

Steps for the novices

@Hans5958
Hans5958 / 0-simple-crossposter.py
Last active August 1, 2023 10:27
A simple Reddit crossposter script with Python, using gallery-dl to fetch the posts. Example result: https://www.reddit.com/r/GlitchProductions/comments/15f72v0/glitch_prod_on_ig_what_they_looking_at/
import os
import json
import praw
import subprocess
# Run gallery-dl, get first 10 since a gallery can have at least 10
# subprocess.run(["gallery-dl", "--range", "1-10", "--write-metadata", "-D", "fetch", "https://instagram.com/glitch_prod"])
print("Done fetching")
@Hans5958
Hans5958 / Active Canvas Period.md
Created July 24, 2023 11:16
Contents of Place Atlas Discord server event

Active Canvas Period

r/place of 2023 is underway! We will be active managing the Atlas, primarily updating the canvas, while accepting submission from time to time, depending on availability.

This just an abstract period that we made. This does not mean we don't accept submissions after this Discord event is over.

Speculated end date of r/place based on the event made on the Google Play page of the app. (+ 30 minutes for canvas addition)

Overview: https://discord.com/channels/960791635342524496/961502799579983932/1131277338496217188

@Hans5958
Hans5958 / docker-commands.sh
Last active June 24, 2023 04:36
Some commands that I save for managing my Docker setup.
docker volume create gitlab-runner-config
docker run -d --name gitlab-runner --restart always \
-v /var/run/docker.sock:/var/run/docker.sock \
-v gitlab-runner-config:/etc/gitlab-runner \
gitlab/gitlab-runner:latest
docker exec -it gitlab-runner gitlab-runner register
docker ps -f status=exited | grep "\-cache-" | awk '{print $1}' | xargs docker rm
docker kill $(docker ps -q) --signal=SIGINT