Skip to content

Instantly share code, notes, and snippets.

@oleid
oleid / GTK4-RS-Windows-MSVC-notes.md
Last active April 10, 2023 00:48
Notes on how to build gtk4-rs projects on Windows with MSVC

I'm not really a windows user, but given the latest discussion on the rust subreddit, I thought I give using gtk4-rs on windows a try.

To set up my build environment, I followed this blog post:

https://www.collabora.com/news-and-blog/blog/2021/03/18/build-and-run-gtk-4-applications-with-visual-studio

That way, I successfully built and installed gtk4/master. And I can launch gtk4-demo. Building from the tag 4.3.0 didn't work for me, as the source of glib couldn't be checked out.

In the blog above, things got installed to C:\GNOME. I chose C:\GTK instead, but the name doesn't really matter.

@vivekhaldar
vivekhaldar / cut_silence.py
Last active November 21, 2025 13:08
Python script to cut out silent parts from a video. Uses moviepy.
#!/usr/bin/env python
#
# Based on a script by Donald Feury
# https://gitlab.com/dak425/scripts/-/blob/master/trim_silenceV2
# https://youtu.be/ak52RXKfDw8
import math
import sys
import subprocess
import os
@CatsMiaow
CatsMiaow / main.ts
Created June 12, 2020 05:26
Comlink example for Node.js with TypeScript
/**
* https://github.com/GoogleChromeLabs/comlink/blob/master/docs/examples/06-node-example/main.mjs
* https://github.com/GoogleChromeLabs/comlink/issues/476#issuecomment-642765445
* esModuleInterop to true in tsconfig.json compilerOptions.
*/
import { Worker } from 'worker_threads';
import * as comlink from 'comlink';
import nodeEndpoint from 'comlink/dist/umd/node-adapter';
import { cpus } from 'os';
@onlurking
onlurking / programming-as-theory-building.md
Last active November 25, 2025 03:11
Programming as Theory Building - Peter Naur

Programming as Theory Building

Peter Naur

Peter Naur's classic 1985 essay "Programming as Theory Building" argues that a program is not its source code. A program is a shared mental construct (he uses the word theory) that lives in the minds of the people who work on it. If you lose the people, you lose the program. The code is merely a written representation of the program, and it's lossy, so you can't reconstruct

@acampagnaro
acampagnaro / How to fix a corrupt zsh history file
Last active September 28, 2025 13:59
How to fix a corrupt zsh history file
How to fix a corrupt zsh history file
Occasionally you may find you have a corrupt zsh history file preventing you from using the `fc` command or searching the history. Here's how to fix it.
Estimated reading time: 1 minutes
Table of contents
Corrupt ZSH history file
How to fix it
Making it a script
Corrupt ZSH history file
If you use zsh for your shell very occasionally you may find the following message appearing indicating a corrupt history file. This is normally after a reboot.
@SevenOutman
SevenOutman / useAbortableAsyncCallback.js
Created August 14, 2019 10:13
React hook for async callback that automatically aborts on component unmount.
export default function useAbortableAsyncCallback(callback, inputs) {
const abortHandleRef = useRef();
const runAbortHandle = useCallback(() => {
if (abortHandleRef.current) {
abortHandleRef.current();
}
}, []);
@andy-thomason
andy-thomason / Genomics_A_Programmers_Guide.md
Created May 14, 2019 13:32
Genomics a programmers introduction

Genomics - A programmer's guide.

Andy Thomason is a Senior Programmer at Genomics PLC. He has been witing graphics systems, games and compilers since the '70s and specialises in code performance.

https://www.genomicsplc.com

@laggardkernel
laggardkernel / startup-time-of-zsh.md
Last active December 1, 2025 23:28
Comparison of ZSH frameworks and plugin managers

Comparison of ZSH frameworks and plugin managers

Changelog

  • update 1: add a FAQ section
  • update 2: benchmark chart and feature comparison table
  • update 3:
    • improve the table with missing features for antigen
    • new zplg times result

TLDR

#!/usr/bin/env python
import re
import gzip
import argparse
from collections import defaultdict
class Alignment:
def __init__(self, in_r_start, in_r_end, in_q_start, in_q_end, in_cigar, in_strand, in_num_matches, in_aln_len, in_num_mismatches):