Skip to content

Instantly share code, notes, and snippets.

View coniel's full-sized avatar
🏠
Working from home

Oscar Coniel coniel

🏠
Working from home
View GitHub Profile
@charrondev
charrondev / tauri_traffic_light_positioner_plugin.rs
Last active September 1, 2025 20:18
This code describes a mechanism to adjust traffic light positioning on MacOS with Tauri 2.x
use objc::{msg_send, sel, sel_impl};
use rand::{distributions::Alphanumeric, Rng};
use tauri::{
plugin::{Builder, TauriPlugin},
Manager, Runtime, Window,
}; // 0.8
const WINDOW_CONTROL_PAD_X: f64 = 15.0;
const WINDOW_CONTROL_PAD_Y: f64 = 23.0;
@Hoohm
Hoohm / gist:972ad0148876bec90d87
Last active June 18, 2025 06:05
Create a unique identifier for a file
def create_file_id(file_path, block_size=256):
'''
Function that takes a file and returns the first 10 characters of a hash of
10 times block size in the middle of the file
Input: File path as string
Output: Hash of 10 blocks of 128 bits of size as string plus file size as string
'''
file_size = os.path.getsize(file_path)
start_index = int(file_size / 2)
with open(file_path, 'r') as f:
@mislav
mislav / _readme.md
Last active July 22, 2025 23:54
tmux-vim integration to transparently switch between tmux panes and vim split windows

I use tmux splits (panes). Inside one of these panes there's a Vim process, and it has its own splits (windows).

In Vim I have key bindings C-h/j/k/l set to switch windows in the given direction. (Vim default mappings for windows switching are the same, but prefixed with C-W.) I'd like to use the same keystrokes for switching tmux panes.

An extra goal that I've solved with a dirty hack is to toggle between last active panes with C-\.

Here's how it should work: