Skip to content

Instantly share code, notes, and snippets.

View ctrlcctrlv's full-sized avatar
🛠️
happy hacking

Fredrick Brennan ctrlcctrlv

🛠️
happy hacking
View GitHub Profile
@ctrlcctrlv
ctrlcctrlv / fontinfo.json
Last active March 31, 2021 17:13
Computer Modern instances
{
"fonts": [
{
"instance": {
"filename": "cmmi6.mf",
"name": "Computer Modern Math Italic 6 point",
"id": "CMMI",
"size": "6pt#",
"type": "mathit"
},
@ctrlcctrlv
ctrlcctrlv / nib_stroker.rs
Created March 24, 2021 02:49
Nib stroker from FontForge (WIP 2)
#![feature(fn_traits)]
use fontforge_sys as fontforge;
use glifparser;
use std::fs;
use std::os::raw;
use std::ops::Fn;
use std::ptr;
#[derive(Default, Debug, PartialEq)]
#!/usr/bin/env python3
# If you have a font that you've already added A-Z smallcaps to, and it has a bunch of precombined characters (e.g. İ, Ĵ, Ṡ, Ẅ), this script will select candidates for automatic building of precombined small caps via «Element→Style→Add Small Capitals…» in FontForge.
import fontforge
import unicodedata
import sys
import string
f = fontforge.activeFont()
@ctrlcctrlv
ctrlcctrlv / JimWatkinsArchives.md
Last active March 28, 2021 06:21
Jim Watkins archive magnet links directory(ジム・ワトキンスについてアーカイブのマグネットリンク集)

This is an updated list of my Jim Watkins archives.

In case you don't know what to do:

  • download qBittorrent for Windows, Mac, or GNU/Linux
    (no relation to Q the anon, Qt is a programming thing and the "q" comes from that)
  • open it
  • press "Open URL"
  • paste in any of, or all of, the magnet lines starting with magnet: below
  • be prepared to wait a while. please seed!
@ctrlcctrlv
ctrlcctrlv / unique_representations.py
Created January 10, 2021 16:02
Just a bit of Twitter fun
D=dict();E=dict();[(E.__setitem__(float(v),u), (D.__setitem__(float(v), D.__getitem__(float(v))+1) if D.__contains__(float(v)) else D.__setitem__(float(v),1))) for (u, _, v) in [e.split()[:3] for e in list(filter(lambda s: re.match('^[0-9A-F]',s), dnv))] if len(u.split('..'))==1];(D.keys(),{k:(v,E[k],chr(int(E[k],16))) for (k,v) in D.items() if v==1})
@ctrlcctrlv
ctrlcctrlv / splash_20th_anniversary.diff
Last active November 7, 2020 11:17
FontForge 20ᵗʰ Anniversary Splash Diff WIP
diff --git a/fontforgeexe/startui.c b/fontforgeexe/startui.c
index eca0b41ca..a3ae02268 100644
--- a/fontforgeexe/startui.c
+++ b/fontforgeexe/startui.c
@@ -206,99 +206,74 @@ static void InsCharHook(GDisplay *gd,unichar_t ch) {
extern GImage splashimage;
static GWindow splashw;
static GTimer *autosave_timer, *splasht;
-static GFont *splash_font, *splash_italic, *splash_mono;
-static int as,fh, linecnt;
@ctrlcctrlv
ctrlcctrlv / ftp_servers_launch.sh
Created October 19, 2020 02:00
Launch an FTP server for each drive letter (MSYS2 / pyftpdlib)
#!/bin/bash
# A problem I commonly experience on Windows is wanting to access all files via
# another computer on the network running Linux or a phone running Android.
#
# While it is technically possible to use Samba shares, this is annoying to set
# up. Usually I just spawn FTP servers. But an annoying thing about Windows is
# its concept of multiple roots. While it's also possible to "mount" a drive
# letter under C:\ in Windows I think, this is also annoying to set up.
#
# So, I use this script. Running as:
@ctrlcctrlv
ctrlcctrlv / PKGBUILD
Created October 16, 2020 08:50
AUR sile without system Luarocks
# Hacked up by: Fredrick Brennan <copypaste📧kittens✝ph>
# Maintainer: Caleb Maclennan <caleb@alerque.com>
# Maintainer: Adrián Pérez de Castro <aperez@igalia.com>
pkgname=sile-git
pkgdesc='Modern typesetting system inspired by TeX'
pkgver=0.10.12.r7.g1992646
pkgrel=1
arch=('x86_64')
url='https://www.sile-typesetter.org'
@ctrlcctrlv
ctrlcctrlv / Trust the scam.php
Created September 21, 2020 13:57
Post as Q on any vichan/OpenIB/infinity/Tinyboard-based imageboard
<?php
/* Post as Q in vichan/OpenIB. As r00t, put this in inc/instance-config.php.
* Works on any imageboard based on 8chan's software. lol */
event_handler("post", function($post) {
global $mod;
// Q's actual tripcode, per QANON.PUB
@define("Q_TRIPCODE", "!!Hs1Jq13jV6");
// ...Or whatever condition you want.
@ctrlcctrlv
ctrlcctrlv / bezctx.rs
Created September 21, 2020 03:53
raphlinus/spiro transpiled by c2rust
#![allow(dead_code, mutable_transmutes, non_camel_case_types, non_snake_case,
non_upper_case_globals, unused_assignments, unused_mut)]
#![register_tool(c2rust)]
#![feature(register_tool)]
#[derive(Copy, Clone)]
#[repr(C)]
pub struct _bezctx {
pub moveto: Option<unsafe extern "C" fn(_: *mut bezctx, _: libc::c_double,
_: libc::c_double, _: libc::c_int)
-> ()>,