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 / jstor_unmetadata.bash
Last active December 30, 2022 12:51
JSTOR remove PDF download information (your IP and the date)
#!/bin/bash
# RIP Aaron Swartz, killed by corporate greed. (Not JSTOR itself, they are a charity;
# I mean the publishers they must contract with
# to offer the limited public service that they do.)
#
# “There is no justice in following unjust laws.
# It’s time to come into the light and, in the grand tradition of civil disobedience,
# declare our opposition to this private theft of public culture.” ~ Aaron Swartz
#
# Requires:
# Synthesize a procedure to numerically integrate the 3rd order poly spiral
# Edited for Rust by Fredrick R. Brennan
# (c) 2007–2022 Raph Levien, Fredrick R. Brennan. Apache 2.0 licensed.
from __future__ import division
from __future__ import print_function
tex = False
if tex:
@ctrlcctrlv
ctrlcctrlv / integrate_spiro_128.rs
Created December 21, 2022 05:54
rustc bug report integrate_spiro_128.rs
pub fn integrate_spiro(ks: [f64; 4]) -> [f64; 2] {
let th1: f64 = ks[0];
let th2: f64 = 0.5 * ks[1];
let th3: f64 = 1.0 / 6. * ks[2];
let th4: f64 = 1.0 / 24. * ks[3];
let mut x: f64 = 0.;
let mut y: f64 = 0.;
let ds: f64 = 1.0 / 4 as f64;
let ds2: f64 = ds * ds;
@ctrlcctrlv
ctrlcctrlv / AKKOMA_USERS.asciidoc
Last active December 19, 2022 02:01
Akkoma users table
Table 1. Table "public.users"
Column Type Collation Nullable Default

id

uuid

 

not null

 

email

citext

 

 

 

password_hash

character varying(255)

 

 

 

@ctrlcctrlv
ctrlcctrlv / akkoma.pgsql
Created December 19, 2022 01:29
Default Akkoma PostgreSQL schema
--
-- PostgreSQL database dump
--
-- Dumped from database version 14.6
-- Dumped by pg_dump version 14.6
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
#!/bin/bash
c++ -o aegisub aegisub.p/src_MatroskaParser.c.o aegisub.p/src_aegisublocale.cpp.o aegisub.p/src_ass_attachment.cpp.o aegisub.p/src_ass_dialogue.cpp.o \
aegisub.p/src_ass_entry.cpp.o aegisub.p/src_ass_export_filter.cpp.o aegisub.p/src_ass_exporter.cpp.o aegisub.p/src_ass_file.cpp.o aegisub.p/src_ass_karaoke.cpp.o \
aegisub.p/src_ass_override.cpp.o aegisub.p/src_ass_parser.cpp.o aegisub.p/src_ass_style.cpp.o aegisub.p/src_ass_style_storage.cpp.o aegisub.p/src_async_video_provider.cpp.o \
aegisub.p/src_audio_box.cpp.o aegisub.p/src_audio_colorscheme.cpp.o aegisub.p/src_audio_controller.cpp.o aegisub.p/src_audio_display.cpp.o aegisub.p/src_audio_karaoke.cpp.o \
aegisub.p/src_audio_marker.cpp.o aegisub.p/src_audio_player.cpp.o aegisub.p/src_audio_provider_factory.cpp.o aegisub.p/src_audio_renderer.cpp.o aegisub.p/src_audio_renderer_spectrum.cpp.o \
aegisub.p/src_audio_renderer_waveform.cpp.o aegisub.p/src_audio_timing_dialogue.cpp.o aegisub.p/src_audio_timing_karaoke.cpp.o aegisub.p/src_auto4_base.cpp.
@ctrlcctrlv
ctrlcctrlv / chollima.ass
Created October 19, 2022 20:08
[DPRK Pop] Pochonbo Electronic Ensemble — Chollima on the Wing [북한음악] 보천보전자악단 — 천리마 달린다 ENG/日本語/한국어
[Script Info]
; Script generated by Aegisub 3.3.3
; http://www.aegisub.org/
YCbCr Matrix: TV.601
PlayResX: 1920
PlayResY: 1080
[V4+ Styles]
Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding
Style: english,KP CheonRiMa B,53,&H00FFFFFF,&H000000FF,&H00000000,&H00000000,0,0,0,0,100,100,0,0,1,4.21875,4.21875,5,30,30,21,1
CFLAGS=-O
LIBES=
DESTDIR=/u1/cspencer
INSTALL=/usr/bin/install
all: sudo
install all.install: sudo.install
sudo.install: sudo
@ctrlcctrlv
ctrlcctrlv / broken.svg
Last active September 23, 2022 15:19
`svgo` cleanupIDs bug example files
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
f = fontforge.activeFont()
import unicodedata
for g in f.glyphs():
gn = g.glyphname
if gn[0] == gn[0].upper():
f.selection.select(("more", None), g.glyphname)