Skip to content

Instantly share code, notes, and snippets.

@arch1t3cht
arch1t3cht / renderer_internals.md
Last active July 4, 2026 18:09
What Every Typesetter Should Know about Renderer Internals

What Every Typesetter Should Know about Renderer Internals

ASS subtitle rendering is seen by many people as some arcane black magic. That's because it is. Luckily, you do not need to understand most of the black magic to learn many meaningful lessons about both the behavior and performance of renderers.

Let's get it over with right away and post the diagram:

A Venn diagram showing two completely disjoint circles. One circle is labeled "What typesetters think is bad for performance." The other circle is labeled "What's actually bad for performance."
@maz-1
maz-1 / LyricImporter.lua
Last active August 15, 2025 22:27
Import Lyric file for Aegisub. Depends on https://github.com/davidm/lua-compress-deflatelua
local tr = aegisub.gettext
script_name = tr"Import Lyric file"
script_description = tr"Import Lyric file for Aegisub"
script_author = "domo & SuJiKiNen & maz_1"
script_version = "1.03"
local deflate = require "compress.deflatelua"
local bit = require("bit")
local Kugoo_keys = {64, 71, 97, 119, 94, 50, 116, 71, 81, 54, 49, 45, 206, 210, 110, 105}
@cmatskas
cmatskas / detached-head-merge.ps1
Created August 22, 2015 21:55
Git merge detached head
$git checkout –b temp #makes a new branch from current detached HEAD
$git branch –f master temp #update master to point to the new <temp> branch
$git branch –d temp #delete the <temp> branch
$git push origin master #push the re-established history
This is a Python script to extract GNOME/GTK's color scheme and apply it to Wine, so that the themes (approximately) match.
Instructions:
1. Set your Gnome theme as you would like it
2. Run with a command like "python wine_colors_from_gtk.py"
3. Restart any apps running in Wine. They should match the Gnome theme colors now.
Better description with screenshots here: http://www.endolith.com/wordpress/2008/08/03/wine-colors/
This is also stored on https://code.launchpad.net/~endolith/+junk/wine-color-scraper
@PaulKinlan
PaulKinlan / criticalcss-bookmarklet-devtool-snippet.js
Last active May 7, 2026 18:53
CriticalCSS Bookmarklet and Devtool Snippet.js
(function() {
var CSSCriticalPath = function(w, d, opts) {
var opt = opts || {};
var css = {};
var pushCSS = function(r) {
if(!!css[r.selectorText] === false) css[r.selectorText] = {};
var styles = r.style.cssText.split(/;(?![A-Za-z0-9])/);
for(var i = 0; i < styles.length; i++) {
if(!!styles[i] === false) continue;
var pair = styles[i].split(": ");
@masak
masak / explanation.md
Last active June 9, 2026 17:03
How is git commit sha1 formed

(The below text is licensed with CC0, which means that if you want to use or translate it, that is OK by me.)

Ok, I geeked out, and this is probably more information than you need. But it completely answers the question. Sorry. ☺

Locally, I'm at this commit:

$ git show
commit d6cd1e2bd19e03a81132a23b2025920577f84e37
Author: jnthn <jnthn@jnthn.net>

Date: Sun Apr 15 16:35:03 2012 +0200

@schmidsi
schmidsi / jquery.getbgimage.js
Created October 10, 2011 18:32
getBgImage: Simple Jquery Plugin to get the dimensions or other attributes from a css background-image
// Inspired by http://stackoverflow.com/questions/5106243/how-do-i-get-background-image-size-in-jquery, a simple jquery plugin who does the task
$.fn.getBgImage = function(callback) {
var height = 0;
var path = $(this).css('background-image').replace('url', '').replace('(', '').replace(')', '').replace('"', '').replace('"', '');
var tempImg = $('<img />');
tempImg.hide(); //hide image
tempImg.bind('load', callback);
$('body').append(tempImg); // add to DOM before </body>
tempImg.attr('src', path);
@ryanflorence
ryanflorence / static_server.js
Last active July 3, 2025 03:26
Node.JS static file web server. Put it in your path to fire up servers in any directory, takes an optional port argument.
var http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs")
port = process.argv[2] || 8888;
http.createServer(function(request, response) {
var uri = url.parse(request.url).pathname
, filename = path.join(process.cwd(), uri);
@endolith
endolith / Readme.txt
Last active March 27, 2026 13:15
Gnome to Wine color scraper
This is a Python script to extract GNOME/GTK's color scheme and apply it to Wine, so that the themes (approximately) match.
Instructions:
1. Set your Gnome theme as you would like it
2. Run with a command like "python wine_colors_from_gtk.py"
3. Restart any apps running in Wine. They should match the Gnome theme colors now.
Better description with screenshots here: http://www.endolith.com/wordpress/2008/08/03/wine-colors/
This is also stored on https://code.launchpad.net/~endolith/+junk/wine-color-scraper