Skip to content

Instantly share code, notes, and snippets.

View AnonymerNiklasistanonym's full-sized avatar
🇺🇦

Niklas AnonymerNiklasistanonym

🇺🇦
View GitHub Profile
@AnonymerNiklasistanonym
AnonymerNiklasistanonym / convert.sh
Created February 26, 2024 04:44
Horizontally flip png images and overlay an png image on top of them, then convert the png images to an animated webp image
#!/usr/bin/env bash
# Horizontally flip png images and overlay an png image on top of them
for filename in frame_*.png
do
echo "Update $filename"
# Horizontal flip
magick "$filename" -flop "$filename"
# Add overlay image
magick convert "$filename" "../overlay.webp" -gravity Center -composite "$filename"
@AnonymerNiklasistanonym
AnonymerNiklasistanonym / package.json
Created February 19, 2024 21:30
Add colored stroke around objects in transparent (.png) image
{
"dependencies": {
"sharp": "^0.33.2",
"ts-node": "^10.9.2"
},
"scripts": {
"start": "ts-node script.ts"
}
}
@AnonymerNiklasistanonym
AnonymerNiklasistanonym / erase.sh
Created February 9, 2024 07:43
Replace certain rectangles on images with transparent areas
#!/usr/bin/env bash
# Replace certain rectangles on an osu! skin with transparent areas
# Based on: https://stackoverflow.com/a/64823099
# Used skin: https://drive.google.com/file/d/1pEWOl8hRefi9ZGCitIrKaso-K7jBgj9b/view (- Project HKttyCatz V1.0.0 -.osk)
for filename in ./scorebar-bg*.png; do
WIDTH=$(identify -format '%w' "$filename")
HEIGHT=$(identify -format '%h' "$filename")
if [[ "$filename" == *@2x* ]]; then
@AnonymerNiklasistanonym
AnonymerNiklasistanonym / README.md
Last active December 28, 2023 09:53
Linux OBS Configuration to Stream to Twitch audio without saving it to the VOD

With the following configuration it is possible to stream 2 audio sinks to Twitch and then on the VOD mute one of the sinks while at the same time hearing forwarding both audio streams to your headphone audio output/sink.

Pipewire

How to add virtual audio sinks and make them loop back to another audio sink

See what audio sinks exist

pactl list | grep Name                                                                                                         
@AnonymerNiklasistanonym
AnonymerNiklasistanonym / ipynb_format_code_cells.py
Created October 21, 2023 16:12
Format Python code cells in Jupyter Notebook (*.ipynb) file/s using black
import argparse
import black
import json
import re
from pathlib import Path
def ipynb_format_code_cells(path: Path, verbose: bool) -> tuple[Path, int]:
json_data = {}
# Tower of Hanoi
# setup:
# - 3 towers
# - N disks on tower 1 stacked in increasing size (largest on the bottom)
# goal: move the entire stack to another rod
# rules:
# - Only one disk can be moved at a time
# - Each move consists of taking the upper disk from one of the stacks and placing it on top of another stack
# - No disk may be placed on top of a smaller disk.
@AnonymerNiklasistanonym
AnonymerNiklasistanonym / bottom_up_parser.md
Last active February 27, 2023 07:58
Basic (naive) Parsing Algorithms

Bottom-Up Parser(word='dnvdndn'):

Grammar:

  • S $\rightarrow$ NP VP
  • NP $\rightarrow$ 'd' 'n'
  • VP $\rightarrow$ 'v' NP NP | 'v' NP

| | stack | input | action |

@AnonymerNiklasistanonym
AnonymerNiklasistanonym / README.md
Last active February 26, 2023 20:29
Cookie Clicker Scripts (Steam, v2.048)

Cookie Clicker Scripts (Steam, v2.048)

Make console available to paste the scripts

Source

  1. Open Steam and select the game in the library view
  2. Make a right click on the entry and select Browse Local Files
  3. Go to the resources/app directory
  4. Edit the file start.js by changing the following line from originally DEV=0 to:
@AnonymerNiklasistanonym
AnonymerNiklasistanonym / open_stream_in_bg_streamlink.ps1
Last active March 22, 2023 09:10
Scripts to stream online streams via streamlink or YouTube playlists using youtube-dl to VLC (very low CPU usage)
@AnonymerNiklasistanonym
AnonymerNiklasistanonym / create_update_apex_package_loss_firewall_rule.ps1
Last active January 7, 2024 22:03
Block APEX LEGENDS servers that have package loss using Telekom internet in Germany
#!/usr/bin/env pwsh
# Block Apex Package Loss servers in Germany/EU with Telekom (Fiber!)
# Certain servers somehow give huge amounts of package loss without any reason or pattern.
#
# Other people with the same problem:
# - https://www.reddit.com/r/apexlegends/comments/siuiox/workaround_for_package_loss_when_using_telekom/
# - https://www.youtube.com/watch?v=60z7LhHtIr8
# Run this command if you can't execute any scripts