Skip to content

Instantly share code, notes, and snippets.

@disler
disler / youtube.py
Created January 6, 2025 01:16
YT Transcript Download
import subprocess
import os
def download_yt_script(url: str) -> str:
"""
Download and extract script from YouTube video
Credit:
Original Code: https://github.com/davidgasquez/dotfiles/blob/bb9df4a369dbaef95ca0c35642de491c7dd41269/shell/zshrc#L75
Simonw Blog: https://simonwillison.net/2024/Dec/19/
@ksprashu
ksprashu / GEMINI-pre-merge.md
Last active December 17, 2025 06:08
GEMINI.md global instructions (Pre-merge)

Gemini Agent: Core Directives and Operating Protocols

This document defines your core operational directives as an autonomous AI software development agent. You must adhere to these protocols at all times. This document is a living standard; you will update and refactor it continuously to incorporate new best practices and maintain clarity.

1. Core Directives

These are the highest-level, non-negotiable principles that govern your operation.

  • Primacy of User Partnership: Your primary function is to act as a collaborative partner. You must always seek to understand user intent, present clear, test-driven plans, and await explicit approval before executing any action that modifies files or system state.
  • Teach and Explain Mandate: You must clearly document and articulate your entire thought process. This includes explaining your design choices, technology recommendations, and implementation details in project documentation, code comments, and direct communication to facilitate user learnin
@jessepearson
jessepearson / functions.php
Last active December 17, 2025 06:07
Disables opening Terms and Conditions on WooCommerce Checkout page in an inline form and instead open in a new tab or window.
<?php // do not copy this line
/**
* Disables opening the Terms and Conditions page in an inline form on the Checkout page.
* The Terms and Conditions link will then open in a new tab/window.
*/
add_action( 'wp', function() {
remove_action( 'woocommerce_checkout_terms_and_conditions', 'wc_checkout_privacy_policy_text', 20 );
remove_action( 'woocommerce_checkout_terms_and_conditions', 'wc_terms_and_conditions_page_content', 30 );
} );
@bobatkey
bobatkey / cont-cwf.agda
Last active December 17, 2025 06:05
Construction of the Containers / Polynomials CwF in Agda, showing that function extensionality is refuted
{-# OPTIONS --rewriting #-}
module cont-cwf where
open import Agda.Builtin.Sigma
open import Agda.Builtin.Unit
open import Agda.Builtin.Bool
open import Agda.Builtin.Nat
open import Data.Empty
import Relation.Binary.PropositionalEquality as Eq
@jboner
jboner / latency.txt
Last active December 17, 2025 06:04
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@SajagIN
SajagIN / main.md
Created June 8, 2025 12:24
Logging in to GitHub via SSH Key

Logging in to GitHub via SSH Key

This guide will walk you through the process of setting up SSH key authentication for your GitHub account, providing a secure and convenient way to interact with your repositories without repeatedly entering your username and password.

Step 1: Generate a New SSH Key Pair

This step creates two essential files: a private key (which remains secret on your computer) and a public key (which you'll share with GitHub).

  1. Open Git Bash.
  2. Type the following command and press Enter:
@HimDek
HimDek / Install Android apps or apk files in Windows using Windows Subsystem for Android (No Emulator).md
Last active December 17, 2025 06:00
This Guide will show you how to install and run apk files or Android apps in any Edition of Windows 11 using Windows Subsystem for Android. WSA or Windows Subsystem for Android is a Tool that allows Windows to run Android Apps directly without using any emulator.

Install Android apps or apk files in Windows using Windows Subsystem for Android

WSA or Windows Subsystem for Android is a Tool that allows Windows to run Android Apps directly without using any emulator. The problem is Windows Subsystem for Android is currently only available through preview via the Beta Channel of the Windows Insider Program. But if you follow my guide, you don't have to be in Windows Insider Program to try it out. The only thing you need is Windows 11 installed and some patience.

Prerequisites:

  • Windows Subsystem for Android or WSA must be Installed.

Click here to view the guide that shows how to install Windows Subsystem for Android in any Edition of Windows 11 (including Windows 11 Home) non Inider or stable release.

How to Install Android Apps or apk files in Windows Subsystem for Android:

@peppergrayxyz
peppergrayxyz / qemu-vulkan-virtio.md
Last active December 17, 2025 05:57
QEMU with VirtIO GPU Vulkan Support

QEMU with VirtIO GPU Vulkan Support

With its latest reales qemu added the Venus patches so that virtio-gpu now support venus encapsulation for vulkan. This is one more piece to the puzzle towards full Vulkan support.

An outdated blog post on clollabora described in 2021 how to enable 3D acceleration of Vulkan applications in QEMU through the Venus experimental Vulkan driver for VirtIO-GPU with a local development environment. Following up on the outdated write up, this is how its done today.

Definitions

Let's start with the brief description of the projects mentioned in the post & extend them:

// ==UserScript==
// @name Fix for BatoTo's Non-Loading Pages - Fallback to other servers
// @namespace http://tampermonkey.net/
// @version 2.0.2
// @description Automatically retries broken BatoTo images using a multi-stage fallback: letter swap, and a targeted brute-force search.
// @author ItachiUchiha
// @homepageURL https://gist.github.com/ItachiUchiha-IU/8fb58bc48b120e88ecd1462aed06f3f8
// @supportURL https://gist.github.com/ItachiUchiha-IU/8fb58bc48b120e88ecd1462aed06f3f8/comments
// @updateURL https://gist.githubusercontent.com/ItachiUchiha-IU/8fb58bc48b120e88ecd1462aed06f3f8/raw/Fix%2520for%2520BatoTo's%2520Non-Loading%2520Pages%2520-%2520Fallback%2520to%2520other%2520servers.user.js
// @downloadURL https://gist.githubusercontent.com/ItachiUchiha-IU/8fb58bc48b120e88ecd1462aed06f3f8/raw/Fix%2520for%2520BatoTo's%2520Non-Loading%2520Pages%2520-%2520Fallback%2520to%2520other%2520servers.user.js