Skip to content

Instantly share code, notes, and snippets.

@yutsuku
yutsuku / snekjail.theme.css
Created August 23, 2023 12:23
discord theme that requires https://betterdiscord.app/
/**
* @name snekjail
* @author moh
* @description to the jail you go
* @version 2023.08.23
*/
bd-body
{
position: absolute;
# Delete everything in current location using path literal.
# Windows explorer and regular commands are unable to delete those folders/files due to invalid characters.
Get-ChildItem -Recurse | ForEach-Object { Remove-Item -LiteralPath "\\?\$($_.FullName)" -Force }
// ==UserScript==
// @name DoujinStyle Download Command
// @namespace http://tampermonkey.net/
// @version 0.3
// @description Replaces donwload button with download link. You will need to disable Same Origin Policy in your browser (using addon like https://addons.mozilla.org/en-US/firefox/addon/cors-everywhere).
// @author moh@yutsuku.net
// @match https://doujinstyle.com/
// @match https://doujinstyle.com/?p=home*
// @match https://doujinstyle.com/?p=page&type=1*
// @grant none
@yutsuku
yutsuku / auto-crop.ps1
Last active January 23, 2022 02:28
Removes black bars from the video using ffmpeg
param (
[Parameter(Mandatory=$true)]
[string]$i,
[Parameter(Mandatory=$false)]
[switch]$preview
)
if (!(Test-Path $i)) {
throw 'Input file does not exist: ' + $i
}
@yutsuku
yutsuku / twitch-vod-chat
Last active January 15, 2022 01:48 — forked from tung/twitch-vod-chat.py
Download chat from a Twitch VOD and print it to a terminal.
#!/usr/bin/env python3
#
# A script to download chat from a Twitch VOD in SubRip (*.srt) format
# Chat will be downloaded all the way until it ends.
#
# Usage: TWITCH_CLIENT_ID=0123456789abcdef0123456789abcde twitch-vod-chat.py [video_id] [start]
#
# This script could break at any time, because Twitch's chat API is
# undocumented and likes to change at any time; in fact, this script was
@yutsuku
yutsuku / yreplay2srt.py
Last active October 25, 2021 01:55 — forked from kfur/yreplay2srt.py
Youtube livechat.json replay to srt subtitles
import pysrt
import json
import sys
import functools
from urllib import request
import re
class LiveChat():
def __init__(self, livechatJson, modOnly, max_comments_view_len=160, max_comments_per_view=4):
@yutsuku
yutsuku / gist:152f91d2e68c6402b7e4e114f1083391
Created October 1, 2021 22:40
powershell_autocrop.ps1
# Auto crop images to bounding box using imagemagick
# You can use scoop to install imagemagick => "scoop install imagemagick"
# Change path and file extension!
Get-ChildItem -Recurse -File -Path "E:\images path\" -Include *.png | ForEach-Object {
$Path = Join-Path -Path 'E:\images path\cropped' -ChildPath $_.Name
C:\Users\moh\scoop\apps\imagemagick\current\convert.exe "`"$($_.FullName)`"" -fuzz 5% -trim +repage "`"$Path`""
}
/**
* @param {String} HTML representing a single element
* @return {Element}
*/
function htmlToElement(html) {
var template = document.createElement('template');
html = html.trim();
template.innerHTML = html;
return template.content.firstChild;
}
/* ==UserStyle==
@name YouTube Discord-like Live chat
@namespace github.com/openstyles/stylus
@version 1.0.3
@description Dark-theme based on Discord, works only for pop-up chat :^)
@author moh@yutsuku.net
@var checkbox fontEnable "Font enabled" 1
@var text fontSize "Font size" 2.1em
==/UserStyle== */
#!/bin/bash
#
# Updates type "A" record for a subdomain with current external IP Address at Cloudflare.
# Obtain API Token at https://dash.cloudflare.com/profile/api-tokens with permissions "Zone.DNS".
#
# Author: moh@yutsuku.net
# Revision: 2021-09-16
#
# Requires: curl, jq, dig
#