Skip to content

Instantly share code, notes, and snippets.

View IsaacGemal's full-sized avatar

Isaac IsaacGemal

View GitHub Profile
@IsaacGemal
IsaacGemal / fuzzymove.sh
Created July 11, 2025 02:48
fuzzymove
# Fuzzymove
fmv() {
local file=$(fd -t f | fzf --preview 'bat --style=numbers --color=always {}' --prompt="📁 File to move: ")
local dest=$(printf ".\n%s" "$(fd -t d)" | fzf --preview 'eza -l --icons --color=always {}' --prompt="📂 Move to: ")
if [[ -n "$file" && -n "$dest" ]]; then
local filename=$(basename "$file")
if [[ -e "$dest/$filename" ]]; then
echo "⚠️ File already exists in $dest. Move aborted."
return 1
@IsaacGemal
IsaacGemal / git-hours.sh
Created April 17, 2025 03:36
Git time histogram
git log --date=format:%H --pretty=format:%ad | \
awk '
{ h = int($0); cnt[h]++; total++ } # collect counts & grand total
END {
# find max bucket to rescale bars
for (i = 0; i < 24; i++) if (cnt[i] > max) max = cnt[i]
barWidth = 50 # chars for the widest bar
for (i = 0; i < 24; i++) {
ampm = (i < 12) ? "AM" : "PM"
// Quick rust matrix math benchmark, written by GPT
use nalgebra::{DMatrix, DVector}; // Make sure to add nalgebra to your Cargo.toml file under [dependencies]
use std::time::Instant;
fn main() {
// Matrix size for the benchmarks
let rows = 500;
let cols = 500;
@IsaacGemal
IsaacGemal / countChatGPTConversations.js
Last active October 12, 2024 15:42
Count your gpt conversatinos
let finalConversationCount = 0;
async function scrollAndCountConversations() {
let conversationContainer = document.querySelector('nav[aria-label="Chat history"]');
let previousCount = 0;
let currentCount = 0;
let maxElements = 100; // Limit to 100 elements for testing, increase as needed
while (currentCount < maxElements) {
let conversationList = document.querySelectorAll('li[data-testid^="history-item"]');