Skip to content

Instantly share code, notes, and snippets.

"""
This is a script for creating English subtitle files for movie files.
Note that all descendants of the given folder are processed, not just those directly under the folder.
Subtitles are transcribed from English audio tracks using the Whisper model, so the quality is almost the same as CC (Closed Caption).
The srt file generated by this script is automatically loaded by players such as MPC (Media Player Classic) and it's derivatives.
This script requires:
- NVIDIA graphics card with sufficient memory (12GB+ recommended)
@rubyu
rubyu / karabiner-elements.json
Last active April 11, 2023 16:14
F1-12, ←↑↓→, Home-End, PageUp-PageDown
{
"title": "F1-12, ←↑↓→, Home-End, PageUp-PageDown",
"rules": [
{
"description": "fn + 1 -> F1",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "1",
import os
import csv
import math
import shutil
import random
from hashlib import md5
from google.cloud import texttospeech
os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = 'xxxx.json'
@rubyu
rubyu / Build.scala
Last active July 5, 2019 09:57
[WIP] eb2json
import sbt.Keys._
import sbt._
import sbtassembly.AssemblyPlugin.autoImport._
object Build extends sbt.Build {
lazy val commonSettings =
Defaults.coreDefaultSettings ++
Seq(
version := "0.3.2",
scalaVersion := "2.11.8",
#!/bin/python3
import math
import os
import random
import re
import sys
if __name__ == '__main__':
a = int(input().strip())
@rubyu
rubyu / crevice-keyboard-fn.cs
Last active March 3, 2019 09:02
普通のキーボードにファンクションキーを導入するサンプル
// Example for introducing function key to normal keyboard.
// Profile for keyboard geatures.
DeclareProfile("Keyboard");
{
var fn = false;
var Whenever = When(ctx =>
{
@rubyu
rubyu / MaximizeWindow.cs
Last active March 2, 2019 08:18
フォアグラウンドウィンドウをマウスのあるディスプレイ上で最大化する(Ctrl+Shift+F11)
// Script for Crevice https://creviceapp.github.io
[System.Runtime.InteropServices.DllImport("user32.dll")]
static extern short GetKeyState(int nVirtKey);
[System.Runtime.InteropServices.DllImport("user32.dll")]
static extern bool SetWindowPos(IntPtr hWnd, int hWndInsertAfter, int x, int y, int cx, int cy, int uFlags);
{
var activated = false;
// ==UserScript==
// @name HIDIVE Screenshot
// @version 1.0
// @description Tested on Chrome 64 and Firefox 61 with Tampermonkey 4.7.
// @include /^https?://www\.hidive\.com/stream/.*$/
// @require http://html2canvas.hertzen.com/dist/html2canvas.js
// @grant GM_notification
// ==/UserScript==
(function() {
@rubyu
rubyu / rrj.bat
Last active December 7, 2018 04:14
Rename RJxxxxxx.zip files downloaded from dlsite.com
@echo off
:loop
IF "%1"=="" GOTO completed
C:\Python27\python.exe C:\Users\user\Documents\BTSync\rubyu\code\rrj\rrj.py %1
SHIFT
GOTO loop
:completed
// ==UserScript==
// @name Crunchyroll Screenshot
// @version 1.4
// @description Tested on Chrome 64 and Firefox 61 with Tampermonkey 4.7 and Crunchyroll HTML5 0.12.0.
// @include /^https?://www.crunchyroll\.com/.*$/
// @grant GM_notification
// ==/UserScript==
(function() {
'use strict';