Skip to content

Instantly share code, notes, and snippets.

View rkmax's full-sized avatar

Julian Reyes Escrigas rkmax

View GitHub Profile
@rkmax
rkmax / README.md
Last active July 29, 2025 13:49
Routes external links to your currently active Firefox profile instead of the default one. Useful when running multiple Firefox profiles simultaneously. Includes installer and desktop integration for Hyprland/Wayland systems.

Firefox Broker

Routes external links to the most recently active Firefox profile, solving Firefox's limitation of always opening links in the default profile.

Overview

Firefox Broker is a TypeScript/Deno utility that intelligently routes URLs to the appropriate Firefox profile based on window focus history. Instead of always opening links in the default profile, it identifies which Firefox instance was most recently active and opens the link there.

Features

#!/bin/bash
# YouTube Audio Transcript and Summary Generator
# Usage: ./yt-audio-transcript.sh [-f] <youtube_url>
# Options: -f Force processing even if cached files exist
# Requirements: pyenv
set -e
#!/usr/bin/env -S deno run --allow-env --allow-run --allow-read --allow-write
import { parseArgs } from "jsr:@std/cli/parse-args";
export async function copy(text: string): Promise<void> {
const cmd = new Deno.Command("wl-copy", {
stdin: "piped",
});
const process = cmd.spawn();
const writer = process.stdin.getWriter();
@rkmax
rkmax / translate.ts
Last active December 28, 2024 17:40
Clipboard Translator using OpenAI/Ollama API This Deno script translates text from your clipboard using LLM and copies the result back to your clipboard
#!/usr/bin/env -S deno run --allow-net --allow-env --allow-run --allow-read --allow-write
import { load } from "https://deno.land/[email protected]/dotenv/mod.ts";
// import { copy, paste } from "https://deno.land/x/[email protected]/mod.ts";
type TranslationProvider = "openai" | "ollama";
// If you are not using wayland.
// commented out or remove the functions copy/paste
#!/bin/zsh
#
# Translate clipboard text using OpenAI's GPT-4 model.
# Requires OpenAI API key.
# Requires xclip (X11) or wl-clipboard (Wayland) to access clipboard.
# Requires jq, curl, sed.
default_system="Translate any user input into English, informal and concise."
get_content_from_clipboard() {
@rkmax
rkmax / gpt.zsh
Created October 21, 2024 14:38
#!/bin/zsh
gpt() {
if [[ ! $+commands[curl] ]]; then
echo "Curl must be installed."
return 1
fi
if [[ ! $+commands[jq] ]]; then
echo "Jq must be installed."
return 1
#!/usr/bin/env bash
#
# rofi-vscode.sh - A script to open recent files, folders and workspaces in VS Code.
# requires: rofi, jq, sqlite3
#
# Usage:
# rofi -modi "VSCode:rofi-vscode.sh" -show VSCode
#
vscdb_path="$HOME/.config/Code/User/globalStorage/state.vscdb"
/**
* rofi -dump-theme output.
* Rofi version: 1.7.5
**/
* {
text-color: var(fg0);
padding: 0;
fg2: rgba ( 222, 222, 222, 50 % );
bg2: rgba ( 8, 96, 242, 90 % );
fg1: White;
configuration {
/* modes: "window,drun,run,ssh";*/
font: "Source Code Pro Semi-Bold 14";
/* location: 0;*/
/* yoffset: 0;*/
/* xoffset: 0;*/
/* fixed-num-lines: true;*/
show-icons: true;
terminal: "kitty";
/* ssh-client: "ssh";*/
@rkmax
rkmax / record.sh
Created August 27, 2024 00:16
A Bash script for screen recording, daemon mode, and customizable frame rate and duration.
#!/bin/bash
output_dir="$HOME/Videos/Replays"
rate=30
pipe_path="/tmp/record_control_pipe"
pid_file="/tmp/record_screen.pid"
daemon_pid_file="/tmp/record_screen_daemon.pid"
daemon_log_file="/tmp/record_screen_daemon.log"
record_extension="mp4"
timeout=60