Skip to content

Instantly share code, notes, and snippets.

#![warn(clippy::all, clippy::pedantic, clippy::nursery)]
use flume::bounded;
use std::sync::mpsc::sync_channel;
use std::thread;
const NUM_DIVISORS: i64 = 2000;
fn main() {
// create a channel to dequeue work
@Sporif
Sporif / evhz_higher_rate.patch
Created September 19, 2021 20:58
Allow evhz to detect refresh rates higher than 1000Hz (https://git.sr.ht/~iank/evhz)
diff --git a/evhz.c b/evhz.c
index 3b4d0cf..c7ba33d 100644
--- a/evhz.c
+++ b/evhz.c
@@ -118,13 +118,13 @@ int main(int argc, char *argv[]) {
unsigned long long time, timediff;
unsigned hz = 0;
- time = (unsigned long long)event.time.tv_sec * 1000ULL;
- time += (unsigned long long)event.time.tv_usec / 1000ULL;
@Sporif
Sporif / kwin-input-devices
Last active April 5, 2025 20:42
Enable or disable input devices on KDE
#!/usr/bin/env bash
# Copyright 2025 Amine Hassane
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions: