Skip to content

Instantly share code, notes, and snippets.

View MinmoTech's full-sized avatar
:octocat:
Beep Boop, working correctly

MinmoTech MinmoTech

:octocat:
Beep Boop, working correctly
  • Migaku
View GitHub Profile
@tatsumoto-ren
tatsumoto-ren / subs.md
Last active July 24, 2024 18:25
Japanese Subtitles

📓 Table of Contents 📚 Resources ✉️ Chat


kitsunekko.net jp subtitles

A large repository of japanese subtitles that is updated reasonably often and has a clean design.| The most popular one, you can upload your own subs.| Often have to be retimed.

@rinogo
rinogo / optimal-resize.py
Created March 31, 2021 18:50
Optimally resize an image so that its line height is approximately 32 pixels (Keywords: OpenCV, Tesseract, OCR)
#Optimally resize `img` according to the bounding boxes specified in `boxes` (which is simply the (pruned) results from `pytesseract.image_to_data()`).
#Tesseract performs optimally when capital letters are ~32px tall (https://groups.google.com/g/tesseract-ocr/c/Wdh_JJwnw94/m/24JHDYQbBQAJ). Smaller text obviously can't be OCR'd as accurately, but weirdly enough, larger text causes problems as well. So, this function uses the bounding boxes we've found and resizes the image so that the median line height should be ~32px.
def optimal_resize(img, boxes):
median_height = np.median(boxes["height"])
target_height = 32 #See https://groups.google.com/g/tesseract-ocr/c/Wdh_JJwnw94/m/24JHDYQbBQAJ
scale_factor = target_height / median_height
print("Scale factor: " + str(scale_factor))
#If the image is already within `skip_percentage` percent of the target size, just return the original image (it's better to skip resizing if we can)
skip_percentage = 0.07
@mcarlton00
mcarlton00 / Jellyfin-api-auth-example.py
Last active May 29, 2024 10:44
Example for authenticating to Jellyfin API from Python
import requests
# Define connection details
server_url = 'http://192.168.0.200:8096'
username = 'User'
password = 'Password'
# Build json payload with auth data
auth_data = {
'username': username,
@eshrh
eshrh / vns-on-linux.md
Last active June 28, 2024 19:41
Personal guide to visual novels on linux

Concise visual novel setup on linux

also see this guide which has better compatibility. This guide is forked from it. written by kamui-7

This guide is very close to exactly how I run vn's on my setup. I can't guarantee it'll work for everyone (in fact, i can probably guarantee it's broken for someone/some game)

Packages i use

sudo pacman -S wine-staging giflib lib32-giflib libpng lib32-libpng libldap lib32-libldap gnutls lib32-gnutls mpg123 lib32-mpg123 openal lib32-openal v4l-utils lib32-v4l-utils libpulse lib32-libpulse libgpg-error lib32-libgpg-error alsa-plugins lib32-alsa-plugins alsa-lib lib32-alsa-lib libjpeg-turbo lib32-libjpeg-turbo sqlite lib32-sqlite libxcomposite lib32-libxcomposite libxinerama lib32-libgcrypt libgcrypt lib32-libxinerama ncurses lib32-ncurses libxslt lib32-libxslt libva lib32-libva gtk3 lib32-gtk3 gst-plugins-base-libs lib32-gst-plugins-base-libs lib32-gst-plugins-goo
@rbreaves
rbreaves / macOS keyboard layout for Linux
Last active March 31, 2024 10:35
Universal macOS keyboard layout for Linux - Applies to All Windows and Apple Keyboards
# permanent apple keyboard keyswap
echo "options hid_apple swap_opt_cmd=1" | sudo tee -a /etc/modprobe.d/hid_apple.conf
update-initramfs -u -k all
# Temporary & instant apple keyboard keyswap
echo '1' | sudo tee -a /sys/module/hid_apple/parameters/swap_opt_cmd
# Windows and Mac keyboards - GUI (Physical Alt is Ctrl, Physical Super is Alt, Physical Ctrl is Super)
setxkbmap -option;setxkbmap -option altwin:ctrl_alt_win
@mpagalan
mpagalan / docker-help.md
Created August 30, 2018 09:16 — forked from bradtraversy/docker-help.md
Docker Commands, Help & Tips

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info

@santiagobasulto
santiagobasulto / README.md
Last active May 16, 2021 10:13
Download HumbleBundle books in batch with a simple Python script.

Download HumbleBundle books

This is a quick Python script I wrote to download HumbleBundle books in batch. I bought the amazing Machine Learning by O'Reilly bundle. There were 15 books to download, with 3 different file formats per book. So I scratched a quick script to download all of them in batch.

(Final Result: books downloaded)

@duganchen
duganchen / wine_bottler.md
Last active May 14, 2023 20:27
tter.com/WINE prefix manager. For the FISH shell.

Wine Bottler

I've knocked up a system for managing WINE prefixes from the command-line. It's for FISH, because that's what I use, and it's reasonably versatile and maintainable.

Note 1: I'm going to use "prefix" and "bottle" interchangeably.

Note 2: This is for hardcore command-line users, and it's similar to tools like virtualenv and rbenv. Most people would probably want to use Lutris.

Anyway...

local sense=-20
local speed = mp.get_property("speed")
local detect = false
function f(msg)
if string.find(msg.text, "silence_end") and detect then
mp.set_property("speed",speed)
endmsg=msg.text
detect = false
--print("end")
elseif string.find(msg.text, "silence_start") and detect==false then
@romainl
romainl / vanilla-linter.md
Last active July 22, 2024 17:18
Linting your code, the vanilla way

Linting your code, the vanilla way

You may want a linter plugin to lint your code in Vim but you probably don't need it. At least try the built-in way before jumping on the plugin bandwagon.

Defining makeprg

autocmd FileType <filetype> setlocal makeprg=<external command>

This autocommand tells Vim to use <external command> when invoking :make % in a <filetype> buffer. You can add as many similar lines as needed for other languages.