Skip to content

Instantly share code, notes, and snippets.

View torque's full-sized avatar

T torque

View GitHub Profile
@torque
torque / stripiT.rb
Last active April 28, 2024 02:22
Script to strip various iTunes atoms from purchased AAC files via AtomicParsley.
#!/usr/bin/env ruby
# usage: stripiT.rb file1.m4a file2.m4a file3.m4a
# automatically outputs to file1 - stripped.m4a, file2 - stripped.m4a, and so on.
# Script to remove extraneous/unwanted atoms from iTunes purchased files by way of AtomicParsley.
# Output should be comparable to the atoms left over after reencoding the file in iTunes itself.
# I only care about songs, so I have no clue how well this applies to video files
# Some information taken from: https://code.google.com/p/mp4v2/wiki/iTunesMetadata
@torque
torque / instructions.md
Last active December 6, 2020 01:32
mpv url-overlay example.

Instructions

  1. clone this gist: git clone https://gist.github.com/5af90be72b98bce36a3e.git mpv-url-overlay-example
  2. copy (or symlink) url-overlay.lua to your mpv scripts directory (~/.config/mpv/scripts or ~/.mpv/scripts)
  3. mpv --no-osc url-overlay-example.mkv
  4. Hold tab to highlight all on-screen urls. If you already use tab for something, bind some key to the command mp_url_overlay_show.
  5. Click urls to launch them. On Linux xdg-open is required. Will not work if you have MOUSE_BTN0 bound to another command.
@torque
torque / aae-export.py
Last active August 17, 2020 15:24
Python script for exporting AAE formatted motion tracking data from Blender. Written by lachs0r.
# Copyright (c) 2013, Martin Herkt
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
# AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-- split all selected lines at \N
function argh(sub,sel)
for i = #sel,1,-1 do
local v = sel[i]
local line = sub[v]
line.text = line.text:gsub("\\[Nn]",string.char(6))
for a in line.text:reverse():gfind(("[^%s]+"):format(string.char(6))) do
line.text = a:reverse()
sub.insert(v+1,line)
#!/usr/bin/env python3
import os,sys
import vapoursynth as vs
core = vs.Core()
plugin_dir = "/usr/local/lib/"
core.std.LoadPlugin("{}libffms2.2.dylib".format(plugin_dir))
core.std.LoadPlugin("{}libscxvid.dylib".format(plugin_dir))
function HURR(sub,sel,act)
for x = 1,#sub do
local line = sub[x]
if line.class == "dialogue" then
if line.text:match("^{.-\\i1.-}") and line.text:match("{.-\\i0?.-}$") then
line.text = line.text:gsub("{\\i[01]?}","")
line.text = line.text:gsub("^({.-)\\i1(.-})","%1%2")
line.text = line.text:gsub("({.-)\\i0?(.-})$","%1%2")
line.style = line.style.." italic"
sub[x] = line
@torque
torque / gist:3495682
Created August 28, 2012 06:57
Koi Kaze batch fixes
Fonts:
- Adjust glyph spacing for Artifika
- Fix egregious overuse of Comfortaa
All:
- Make OP/ED timing consistent
01-04:
- Append Chidori's Judgement to main episode.
05:
- Actually draw scribbles over scribbled out text for typesetting.
[
{ "loc":"d-r.bots.json", "type":"botlist" },
{ "loc":"d-r.packlist.json", "type":"packlist" }
]
@torque
torque / kkmux.rb
Created June 28, 2012 05:08
Matroska mux script for Koi Kaze
#!/usr/bin/env ruby
# Usage: ./mux.rb 1 "Spring Breeze" rel
require 'zlib'
require 'fileutils'
epnum = "%02d" % ARGV[0].to_i;
epraw = File.expand_path((Dir["Koi_Kaze_-_Ep#{epnum}_10bit_Raw*.mkv"])[0]) # Get the raw for the main episode
chiraw = File.expand_path((Dir["Koi_Kaze_-_Ex#{epnum}_10bit_Raw*.mkv"])[0]) # Get the raw for Chidori
chapters = File.expand_path("Chapters/Koi Kaze #{epnum}.xml")
fonts = Dir['fonts/*.ttf','fonts/*.otf'] # j-j-j-jam all of the fonts in
gui = {
xlabel = { class = "label"; label = "x scale factor"; x = 0; y = 0; height = 1; width = 1;},
ylabel = { class = "label"; label = "y scale factor"; x = 0; y = 1; height = 1; width = 1;},
xsclf = { class = "floatedit"; name = "xsclf"; value = 1; x = 1; y = 0; height = 1; width = 1;},
ysclf = { class = "floatedit"; name = "ysclf"; value = 1; x = 1; y = 1; height = 1; width = 1;},
}
function drawgui(sub,sel)
local b,c = aegisub.dialog.display(gui)
scale(sub,sel,c)