Skip to content

Instantly share code, notes, and snippets.

View thomasjo's full-sized avatar
🍉

Thomas Johansen thomasjo

🍉
View GitHub Profile
@veekaybee
veekaybee / normcore-llm.md
Last active May 15, 2025 00:06
Normcore LLM Reads

Anti-hype LLM reading list

Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.

Foundational Concepts

Screenshot 2023-12-18 at 10 40 27 PM

Pre-Transformer Models

@pudquick
pudquick / 00-reproducible-mach-o.md
Last active March 18, 2025 04:15
Reproducible Builds for macOS

Reproducible Builds for macOS

There's a neat writeup I stumbled across recently titled "Reproducible codesigning on Apple Silicon" from Keith Smiley about some gotchas when it comes to compiling a binary in a way that's repeatable and always generates the exact same byte output (which would then checksum to the exact same hash) - even if compiled on a different Mac.

In applying the suggestions I found in the blog post, I found a few other corner cases that I just wanted to get documented more explicitly somewhere.

Tools Matter

Footnote 2 from that blog post is important:

@andy108369
andy108369 / ubuntu-2204-remove-snap.md
Created August 17, 2022 07:30 — forked from allisson/ubuntu-2204-remove-snap.md
Ubuntu 22.04 remove snap

Remove snaps

sudo snap remove --purge firefox
sudo snap remove --purge snap-store
sudo snap remove --purge snapd-desktop-integration
sudo snap remove --purge gtk-common-themes
sudo snap remove --purge gnome-3-38-2004
sudo snap remove --purge core20
sudo snap remove --purge bare
sudo snap remove --purge snapd
cd /sys/devices/pci0000\:00/0000\:00\:03.0/0000\:09\:00.0/0000\:0a\:10.0/0000\:0e\:00.0/
systemctl stop kubelet
systemctl stop docker
echo 1 > remove
systemctl start docker
systemctl start kubelet

As far as I can tell, you can't do it conveniently. That is, git-rebase does not give you an option to preserve the committer date. Unless you give the --ignore-date (or its alias, --reset-author-date) option, it will always preserve the author date. However, there is no way to make git-rebase preserve the committer date, unless some manual script is crafted.

The best you can do is to make the committer date equal to the author date. Recently (in 2020 Q4), git-rebase --interactive has gained the ability to use the --committer-date-is-author-date flag with the interactive rebase. Before that, there was no way of influencing the committer date at all with the interactive rebase. Note that this flag does not preserve the committer date. It merely makes the committer date equal to the author date.

You might be thinking "well, isn't that effectively preserving the committer date, since normally the committer date is always equal to the author date?". Normally, you would be correct. However, there

@jamesmishra
jamesmishra / keras_memory_usage.py
Created October 16, 2020 00:17
Calculating Keras model memory usage
def keras_model_memory_usage_in_bytes(model, *, batch_size: int):
"""
Return the estimated memory usage of a given Keras model in bytes.
This includes the model weights and layers, but excludes the dataset.
The model shapes are multipled by the batch size, but the weights are not.
Args:
model: A Keras model.
batch_size: The batch size you intend to run the model with. If you
@fmassa
fmassa / visualize_maskrcnn_predictions.py
Created December 2, 2019 10:52
Script to visualize predictions from torchvision Mask R-CNN
import torch
import numpy as np
import matplotlib.pyplot as plt
import cv2
def select_top_predictions(predictions, threshold):
idx = (predictions["scores"] > threshold).nonzero().squeeze(1)
new_predictions = {}
for k, v in predictions.items():
@allanfreitas
allanfreitas / script.py
Created May 27, 2019 01:16
the-best-way-to-repeatedly-execute-a-function-every-x-seconds-in-python
import time, traceback
def every(delay, task):
next_time = time.time() + delay
while True:
time.sleep(max(0, next_time - time.time()))
try:
task()
except Exception:
traceback.print_exc()
@smagnani96
smagnani96 / linuxNvidia_guide.md
Last active January 31, 2024 22:23
This guide is supposed to help people experiencing problems with the Nvidia dedicated graphic card management.

Linux - Nvidia switchable setup guide

The aim of this guide is to provide a working strategy to make your dedicated graphic card turn on/off correctly in a Linux environment (with xorg).

The following scripts have been created by tyrells and this guide is a remake of Graff's one.

Required Packages

The following two packages are stricly required:

@arturfog
arturfog / gnome-terminal-bold-fonts.sh
Created January 2, 2019 15:03
disable bold fonts in gnome terminal
dconf write /org/gnome/terminal/legacy/profiles:/:<id>/allow-bold false