Skip to content

Instantly share code, notes, and snippets.

View WaffleLapkin's full-sized avatar
🧇
exhaused and vaguely burned

Waffle Maybe WaffleLapkin

🧇
exhaused and vaguely burned
View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
<title>Page Title</title>
<meta name='viewport' content='width=device-width, initial-scale=1'>
<link rel='stylesheet' type='text/css' media='screen' href='lists.css'>
<style>
@WaffleLapkin
WaffleLapkin / list_rustc_branches.fish
Created April 11, 2024 13:34
A lil script to list current branches on all my rustc checkouts
#!/usr/bin/fish
ssh dev-desktop "
hostname;
cd ~/rust-a && echo ' ' (pwd) ':' (git branch --show-current);
cd ~/rust-b && echo ' ' (pwd) ':' (git branch --show-current);
cd ~/rust-c && echo ' ' (pwd) ':' (git branch --show-current);
cd ~/rust-lib && echo ' ' (pwd) ':' (git branch --show-current);
cd ~/rust-tsk && echo ' ' (pwd) ':' (git branch --show-current);
"
@WaffleLapkin
WaffleLapkin / PLASMA_WAYLAND_TRACKBALL.md
Last active March 10, 2024 00:32
plasma + wayland elecom huge trackball settings

This is how I was able to hack around settings for my elecom huge trackball on plasma+wayland (for comparison: similar xorg setup: https://gist.github.com/WaffleLapkin/8b0b739b705e91a0dd9babccd0907267).

/etc/udev/hwdb.d/70-elecom-huge-trackball-remap.hwdb:

# Rebinds keys on elecom huge trackball
#
# tip: You can use `sudo evtest` to get the key values and stuff.
#
# 90001 = L
# 90002 = R
@WaffleLapkin
WaffleLapkin / 40-libinput.conf
Created March 9, 2024 22:38
/etc/X11/xorg.conf.d/40-libinput.conf
Section "InputClass"
Identifier "ELECOM TrackBall Mouse HUGE TrackBall"
MatchProduct "ELECOM TrackBall Mouse HUGE TrackBall"
Driver "libinput"
# idx | phisical button | logical action
# ----+------------------------------------+-----------------
# 1 | "L" button, under the scroll wheel | LMK
# 2 | scroll wheel button | MMK
# 3 | R button, to the right of the ball | RMK
@WaffleLapkin
WaffleLapkin / best-daily-release-time.rs
Last active December 8, 2023 14:41
Calculates the best time to release a daily version
#!/usr/bin/env rust-script
/*!
Shebang is using <https://github.com/fornwall/rust-script>.
Date: 2023-12-08.
Data taken from <https://observablehq.com/@mattdzugan/population-by-time-zone-creating-a-dataset>.
Ideally I'd re-compute it here (and it will probably be faster than their js lol), but I'm too lazy atm.
This is very jank way to find at what point it's the most noon / the most distance from date change.
This is nice for releasing daily versions of software, to prevent off-by-one errors with version naming like Rust's nightly has.
// pseudocode
pub struct ThinSlice<T> {
len: usize,
slice: [T],
}
impl Pointee for ThinSlice<T> {
type Metadata = ThinSliceMetadata<T>;
@WaffleLapkin
WaffleLapkin / what.md
Last active January 1, 2022 12:19
Unordered list of things I don't understand about my computer

What?

I'm using Linux, Arch Linux to be exact. This may have been a bad decision considering how bad am I at computers, but there is no turning back I believe. I can't use windows, for me it's like holy water to a demon or sunlight to a vampire. And for macOS I don't have money.

But, since I'm pretty terrible at computers I don't understand a lot of things. Some things just seem broken, but I have no way of fixing them or even understanding what is happening. This file contains an unordered list of such things.

@WaffleLapkin
WaffleLapkin / remove_gps.bash
Created September 14, 2021 20:07
Remove GPS information from exif tags of all pictures in `./dir`
exiv2 \
-M'del Exif.GPSInfo.GPSLatitudeRef' \
-M'del Exif.GPSInfo.GPSLatitude' \
-M'del Exif.GPSInfo.GPSLongitudeRef' \
-M'del Exif.GPSInfo.GPSLongitude' \
-M'del Exif.GPSInfo.GPSAltitudeRef' \
-M'del Exif.GPSInfo.GPSAltitude' \
-M'del Exif.GPSInfo.GPSTimeStamp' \
-M'del Exif.GPSInfo.GPSImgDirectionRef' \
-M'del Exif.GPSInfo.GPSImgDirection' \
// [dependencies]
// teloxide = "0.4"
// tokio = { version = "1.6", features = ["macros", "rt-multi-thread"] }
// plotters = "0.3"
// image = "0.23"
#[tokio::main]
async fn main() {
run().await;
}
// [dependencies]
// reqwest = "0.11"
// teloxide = "0.4"
// tokio = { version = "1.6", features = ["macros", "rt-multi-thread"] }
#[tokio::main]
async fn main() {
run().await;
}