Skip to content

Instantly share code, notes, and snippets.

@line0
line0 / l0.ReplaceByCharacterText.moon
Last active April 11, 2020 16:23
l0.ReplaceByCharacterText.moon
export script_name = "Replace Character By Text"
export script_description = "Takes GBC lines and replaces each character from a sequence of matching length in the effect field"
export script_version = "0.1.0"
export script_author = "line0"
export script_namespace = "l0.ReplaceByCharacterText"
DependencyControl = require "l0.DependencyControl"
depCtrl = DependencyControl{
feed: "https://raw.githubusercontent.com/TypesettingTools/line0-Aegisub-Scripts/master/DependencyControl.json",
{
export script_name = "Count Layout Lines"
export script_description = "Counts the number of layout lines produced on the canvas per subtitle line."
export script_version = "0.1.0"
export script_author = "line0"
export script_namespace = "l0.CountLayoutLines"
DependencyControl = require "l0.DependencyControl"
depRec = DependencyControl {
feed: "https://raw.githubusercontent.com/TypesettingTools/line0-Aegisub-Scripts/master/DependencyControl.json",
@line0
line0 / RGB48YV12toRGB48Y.avsi
Last active December 29, 2015 11:49
converts RGB48YV12 to RGB48Y
function RGB48YV12toRGB48Y(clip c)
{
vers = VersionNumber()
tPref = IsFunction("FTurnLeft") ? "F" : ""
w = c.Width
h = c.Height
y = (vers < 2.60) ? c : c.ConvertToY8()
u = (vers < 2.60) ? c.UtoY() : c.UtoY8()
v = (vers < 2.60) ? c.VtoY() : c.VtoY8()
@line0
line0 / nnedi3_resize16_v3.0_gpumod.avsi
Last active December 28, 2015 18:59
nnedi3_resize16 v3.0 by mawen1250, modded to use nnedi3ocl with gpu=true
###### nnedi3_resize16 v3.0 ###### by mawen1250 ###### 2013.11.15 ######
###### from v2.8 on, nnedi3_resize16 only supports AviSynth v2.6 ######
###### Requirements: masktools v2.0a48, dither v1.24.0, nnedi3 v0.9.4, ######
###### SmoothAdjust v2.90, Contra-Sharpen mod 3.4, ######
###### FTurn v1.3.5 (not necessarily required but will improve speed) ######
###### Accept Y8, YV12, YV16, YV24 input, use nnedi3 and Dither_resize16(nr) for scaling ######
###### output format can be 8bit/16bit Y8/YV12/YV16/YV24 or RGB32/RGB24/RGB48YV12/RGB48Y ######
Function nnedi3_resize16(clip input, int "target_width", int "target_height", float "src_left", float "src_top",
@line0
line0 / StackedNto16
Last active December 27, 2015 19:49
function StackedNto16(clip c, int n)
{
Assert(8 <= n <= 15, "StackedNto16: bitdepth should be in range 8-15")
h = c.Height / 2
msb = c.Crop(0,0,0,-h)
lsb = c.Crop(0,h,0,0)
shamt = string(16-n)
msb16 = (n != 8) ? msb.mt_lutxy(lsb, "x " + shamt + " << y 8 " + shamt + " - >> +", v=3, u=3) : lsb
lsb16 = (n != 8) ? lsb.mt_lut("x " + shamt + " << 255 &u", v=3, u=3) : msb
@line0
line0 / GM_XHR.js
Last active November 30, 2015 15:44 — forked from Acorn-zz/GM_XHR.js
allows using all Jquery AJAX methods in Greasemonkey
// allows using all Jquery AJAX methods in Greasemonkey
// originally inspired from http://ryangreenberg.com/archives/2010/03/greasemonkey_jquery.php
// works with jQuery 2.1.4
// (c) 2011 Martin Monperrus
// (c) 2010 Ryan Greenberg
// (updated) 2015 line0 to work with current jQuery and more closely mirror contemporary XHR implementations.
//
// Usage:
// $.ajax({
// url: '/p/',
@line0
line0 / GM_fetch.js
Last active November 29, 2015 16:28
Fetch polyfill (https://github.com/github/fetch) stripped down to provide GM_fetch via GM_XHR.
(function() {
'use strict';
var support = {
blob: 'FileReader' in self && 'Blob' in self && (function() {
try {
new Blob();
return true
} catch(e) {
return false
export script_name = "Insert Timecode"
export script_description = "Inserts a running timecode"
export script_version = "0.0.1"
export script_author = "line0"
export script_namespace = "l0.InsertTimeCode"
DependencyControl = require "l0.DependencyControl"
dep = DependencyControl {
feed: "https://raw.githubusercontent.com/TypesettingTools/line0-Aegisub-Scripts/master/DependencyControl.json",
{
#target illustrator
#targetengine main
#include "./lib/polyfills.jsxinc"
app.documents.length > 0 ? l0_impImageSeq() : alert("Please create an empty document before running this script.");
function l0_impVecSeq() {
app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS
var folders = []
function aWarpSharp4xx16 (clip src, int "thresh", int "blur", int "type", int "depth", int "chroma", bool "lsb", string "cplace")
{
chroma = default(chroma, 4)
lsb = default(lsb, false)
cplace = default(cplace, "MPEG2")
assert(src.IsPlanar, "aWarpSharp4xx16: input clip must be planar YUV")
assert(0 <= chroma <= 6, "aWarpSharp4xx16: argument chroma must be an integer between 0 and 6.")
assert(cplace == "MPEG2" || cplace == "MPEG1", "aWarpSharp4xx16: chroma siting must be MPEG2 or MPEG1")