Skip to content

Instantly share code, notes, and snippets.

@savage69kr
savage69kr / CircularMenu.cs
Created September 11, 2023 03:22 — forked from alexanderameye/CircularMenu.cs
Circular menu for the Unity Editor
/*
MIT License
Copyright (c) [year] [fullname]
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
@savage69kr
savage69kr / free-database-hosting.md
Created September 1, 2023 07:20 — forked from bmaupin/free-database-hosting.md
Free database hosting
@savage69kr
savage69kr / syncthing-automerge.py
Created August 25, 2023 02:48 — forked from solarkraft/syncthing-automerge.py
Monitors a Syncthing-synced directory and tries to merge conflicting files (based on https://www.rafa.ee/articles/resolve-syncthing-conflicts-using-three-way-merge/). Probably adaptable for other directory types, but only tested with Logseq (works for me™️).
import os
import time
import re
import subprocess
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
def get_relative_path(path):
return os.path.relpath(path)
@savage69kr
savage69kr / atkinson.py
Created May 24, 2023 05:26 — forked from radupotop/atkinson.py
Atkinson dithering
#!/usr/bin/python2
import sys, PIL.Image
img = PIL.Image.open(sys.argv[-1]).convert('L')
threshold = 128*[0] + 128*[255]
for y in range(img.size[1]):
for x in range(img.size[0]):
@savage69kr
savage69kr / Dockerfile
Created May 8, 2023 09:06 — forked from benperiton/Dockerfile
backgroundremover test
FROM python:3.6-slim
ARG UID
ARG GID
RUN groupadd -g "${GID}" app \
&& useradd --create-home --no-log-init -u "${UID}" -g "${GID}" app
RUN apt-get update && \
apt-get -y install python3-pip && \
@savage69kr
savage69kr / ScreenShotter.cs
Created April 17, 2023 06:16
A screenshot taking tool for Unity. Drop this onto a "ScreenShotter" or similarily named empty object in your scene and configure as desired. The defaults are however pretty good with screenshots being dumped to the top of your project folder every three seconds. Don't forget to exclude this directory in your .gitignore!
using UnityEngine;
using System.IO;
public class ScreenShotter : MonoBehaviour
{
[Header("Filename Settings")]
[SerializeField, Tooltip("Set the destination path. This folder will be placed at the top of your project directory.")]
string fileDestination = "Screenshots/";
@savage69kr
savage69kr / 00-README-NEXT-SPA.md
Created April 3, 2023 09:21 — forked from gaearon/00-README-NEXT-SPA.md
Next.js SPA example with dynamic client-only routing and static hosting

Next.js client-only SPA example

Made this example to show how to use Next.js router for a 100% SPA (no JS server) app.

You use Next.js router like normally, but don't define getStaticProps and such. Instead you do client-only fetching with swr, react-query, or similar methods.

You can generate HTML fallback for the page if there's something meaningful to show before you "know" the params. (Remember, HTML is static, so it can't respond to dynamic query. But it can be different per route.)

Don't like Next? Here's how to do the same in Gatsby.

@savage69kr
savage69kr / widevine_fixup.py
Created March 10, 2023 03:59 — forked from DavidBuchanan314/widevine_fixup.py
Patch aarch64 widevine blobs from ChromeOS to work on non-ChromeOS linux, including platforms with 16K page size like Apple Silicon / Asahi Linux
"""
MIT License
Copyright (c) 2023 David Buchanan
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
@savage69kr
savage69kr / 1-README.md
Created March 10, 2023 03:56 — forked from ruario/1-README.md
A script that fetches a ChromeOS image for ARM32 and extracts the Widevine binary, saving it in a compressed archive for use with Vivaldi

The included script 'widevine-flash_armhf.sh' fetches a ChromeOS image for ARM and extracts the Widevine binary, saving it in a compressed archive. Since it downloads a fairly large file (2Gb+ on disk after download) it is recommended that you run the script on a machine that has plenty of disk space.

To install the resultant archive, issue the following on your ARM machine–after copying over the archive if needed:

sudo tar Cfx / widevine-flash-20200124_armhf.tgz

(Where 'widevine-flash-20200124_armhf.tgz' is updated to reflect the actual name of the created archive)

@savage69kr
savage69kr / fastbook.py
Created March 2, 2023 08:47 — forked from dbieber/fastbook.py
fastbook speeds up the silence in audiobooks, and can speed up the non-silence too
"""Performs automatic speed edits to audio books.
Example usage:
Assuming you have an audiobook book.aax on your Desktop:
1. Convert it to wav:
ffmpeg -i ~/Desktop/book.aax ~/Desktop/book.wav
2. Adjust the speed: