Skip to content

Instantly share code, notes, and snippets.

@ahmed-musallam
ahmed-musallam / compress_pdf.md
Last active December 26, 2025 15:21
How to compress PDF with ghostscript

How to compress PDF using ghostscript

As a developer, it bothers me when someone sends me a large pdf file compared to the number of pages. Recently, I recieved a 12MB scanned document for just one letter-sized page... so I got to googlin, like I usually do, and found ghostscript!

to learn more abot ghostscript (gs): https://www.ghostscript.com/

What we are interested in, is the gs command line tool, which provides many options for manipulating PDF, but we are interested in compressign those large PDF's into small yet legible documents.

credit goes to this answer on askubuntu forum: https://askubuntu.com/questions/3382/reduce-filesize-of-a-scanned-pdf/3387#3387?newreg=bceddef8bc334e5b88bbfd17a6e7c4f9

@ruvnet
ruvnet / Gemini.md
Last active December 26, 2025 15:17
Free & Secure API Key Rotator for Google Gemini 2.5 Pro (Deno Edge Functions)

Great. I’ll develop a phased implementation plan, edge function code, deployment strategy, user guide, and full documentation for a key rotator using Deno Edge Functions. This will focus on rotating Gemini 2.5 Pro API keys to handle 429 rate limits efficiently.

I’ll return with a clear breakdown of components, including a secure architecture, key storage and cycling logic, usage limits, and guidance for setup and customization.

Secure API Key Rotator for Google Gemini 2.5 Pro (Deno Edge Functions)

Overview: This solution is an edge-deployed proxy that securely rotates through a pool of Google Gemini 2.5 Pro API keys to avoid hitting per-key rate limits (e.g. free-tier limit of ~2 requests/minute (Gemini 2.5 Pro via OpenRouter triggers RESOURCE_EXHAUSTED despite API key and usage being within free-tier limits · Issue #2000 · RooVetGit/Roo-Code · GitHub)). By

@arianvp
arianvp / SSH_MACOS_SECURE_ENCLAVES.md
Last active December 26, 2025 15:17
Native Secure Enclaved backed ssh keys on MacOS

Native Secure Enclave backed ssh keys on MacOS

It turns out that MacOS Tahoe can generate and use secure-enclave backed SSH keys! This replaces projects like https://github.com/maxgoedjen/secretive

There is a shared library /usr/lib/ssh-keychain.dylib that traditionally has been used to add smartcard support to ssh by implementing PKCS11Provider interface. However since recently it also implements SecurityKeyProivder which supports loading keys directly from the secure enclave! SecurityKeyProvider is what is normally used to talk to FIDO2 devices (e.g. libfido2 can be used to talk to your Yubikey). However you can now use it to talk to your Secure Enclave instead!

@cathartyc
cathartyc / map-scroll-lock-wayland.md
Last active December 26, 2025 15:14
Fix keyboard with scroll-lock backlight toggle on Wayland

Fix scroll-lock backlight toggle not working on Wayland

The problem

My findings with a Cooler Master Devastator II are that any external keyboard with the backlight toggled by the scroll-lock key will not have a working toggle on any Wayland compositor, by default. The scroll-lock key is detected as such, but the scroll-lock led is not turned on (and thus neither the backlight).

I found some attempts at solving the problem.
Some of them propose to manually flip the state of the led in /sys/class/leds/input...: this is not great, since the file name is going to change sometimes.
Others proposed add a line somewhere in /usr/share/X11/...: in my case, this did not persist system updates.

Furthermore, in both cases root privileges are required. In the first case you even have to either change the SUID of a shell script or type your password on polkit/whatever each time you want to see your keys 💀

@beAnkitK
beAnkitK / ElasticTouchEffect.kt
Last active December 26, 2025 15:14
Elastic touch effect indication for composable. Can be implemented by providing it's instance in indication paramater of interaction modifier or through indication modifier. It has two variant - elasticIn which scale down the content and elaticOut which scales up the content.
package dev.beankitk.effects
import androidx.compose.animation.core.Animatable
import androidx.compose.animation.core.AnimationSpec
import androidx.compose.animation.core.spring
import androidx.compose.foundation.IndicationNodeFactory
import androidx.compose.foundation.interaction.InteractionSource
import androidx.compose.foundation.interaction.PressInteraction
import androidx.compose.runtime.Stable
import androidx.compose.ui.Modifier
@akhan4u
akhan4u / learning_linux.md
Last active December 26, 2025 15:11
Useful websites for Learning Linux
  1. Guided Self learning (https://linuxjourney.com)
  2. Best one liners for linux command line (https://www.commandlinefu.com/commands/browse)
  3. Find files in linux from command line (https://linuxize.com/post/how-to-find-files-in-linux-using-the-command-line)
  4. Improve your typing speed on the command line with this awesome tool! (https://github.com/balzss/cli-typer)
  5. An interactive cheatsheet tool for the command-line (https://github.com/denisidoro/navi)
  6. Customize your shell environment to next level (https://github.com/alebcay/awesome-shell)
  7. I find it useful to learn new things with the self learning courses offered by github (https://lab.github.com)
  8. A static analysis tool for shell scripts (https://github.com/koalaman/shellcheck)
  9. A good collection of bash snippets if you are starting to learn about shell scripts in linux (https://github.com/alexanderepstein/Bash-Snippets)
  10. Linux workshop 10 days (https://linuxessentials.netlify.app)
@dkun7944
dkun7944 / ContentView.swift
Created July 31, 2023 03:36
AirDrop iOS 17 Swift.Shader Animation
//
// ContentView.swift
// Airdrop Demo
//
// Created by Daniel Kuntz on 7/30/23.
//
import SwiftUI
struct ContentView: View {
KFZUS-F3JGV-T95Y7-BXGAS-5NHHP
T3ZWQ-P2738-3FJWS-YE7HT-6NA3K
KFZUS-F3JGV-T95Y7-BXGAS-5NHHP
65Z2L-P36BY-YWJYC-TMJZL-YDZ2S
SFZHH-2Y246-Z483L-EU92B-LNYUA
GSZVS-5W4WA-T9F2E-L3XUX-68473
FTZ8A-R3CP8-AVHYW-KKRMQ-SYDLS
Q3ZWN-QWLZG-32G22-SCJXZ-9B5S4
DAZPH-G39D3-R4QY7-9PVAY-VQ6BU
KLZ5G-X37YY-65ZYN-EUSV7-WPPBS
@yrashk
yrashk / inferal-workspace-architecture.md
Last active December 26, 2025 14:59
Inferal Workspace Architecture

Inferal Workspace Architecture: How We Work at Inferal

Your org's brain that AI can use

This is not our product. This document describes our internal operating environment - how we run the company. We share it to show the environment you'd join and demonstrate our philosophy in action. For what we're building, see What We're Building below.

This document describes the conceptual architecture of our company workspace - a text-based, version-controlled knowledge and operations hub designed to replace tools like Notion and Webflow while being natively accessible to AI assistants.

Why We Built This