Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>Ruby WASM Todo</title>
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>
<!-- Ruby WASM: UMD runtime + 4.0 stdlib wasm -->
<script src="https://cdn.jsdelivr.net/npm/@ruby/wasm-wasi@2.8.1/dist/browser.umd.js"></script>
<style>
@rahuldhole
rahuldhole / README.md
Created February 16, 2026 14:26 — forked from piyushgarg-dev/README.md
Kafka Crash Course
@rahuldhole
rahuldhole / _sidebar.md
Last active February 7, 2026 20:42
Publish your markdown docs/ folder with a single html file
@rahuldhole
rahuldhole / openapi.html
Last active February 3, 2026 23:52
Publish openapi docs
<!DOCTYPE html>
<!--
OpenAPIViewer
Source: https://gist.github.com/rahuldhole/3b943093745455f569e9656601a2b672
Usage:
- add link to your openapi file in `SwaggerUIBundle` url
- Update topbar links (Link1, Link2) if needed
-->
<html lang="en">
<head>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Markdown Viewer</title>
<!-- 1. Tailwind CSS for layout -->
<script src="https://cdn.tailwindcss.com"></script>
@rahuldhole
rahuldhole / zatu.rb
Last active December 28, 2025 23:46
Ruby quick testing library
require 'json'
module Zatu
module_function
# fn: callable (Proc, lambda, or Method)
# cases: hash mapping input (JSON string) => expected output
def assert_equal(fn, cases)
ok = 0
total = cases.size
@rahuldhole
rahuldhole / algorithms-quiz.json
Last active December 23, 2025 08:09
Quizya files
{"quizzes":[{"id":"array-contains-duplicate","title":"Contains Duplicate","category":"Algorithms","subcategory":"Array & Hashing","description":"Find if any value appears at least twice.","link":"https://leetcode.com/problems/contains-duplicate/","solutionLink":"https://www.youtube.com/watch?v=3OamzN90kPg","questions":[{"question":"What's faster: Set.has() or Array.includes() for checking if we've seen a number?","options":["Set.has()","Array.includes()","They're the same","Depends on the array size"],"answerIndex":0,"explanation":"Set.has() is O(1) average time while Array.includes() is O(n) - Set wins!","tags":["javascript","dataStructure"]},{"question":"What does this return: new Set([1,2,2,3]).size?","options":["3","4","2","Error"],"answerIndex":0,"explanation":"Sets remove duplicates automatically - [1,2,3] gives size 3.","tags":["javascript","dataStructure"]},{"question":"Should we use Set or Map for just checking duplicates?","options":["Set - we just need to track seen values","Map - we need key-value
@rahuldhole
rahuldhole / testAssertEqual.js
Last active December 10, 2025 16:20
A simple test utility to run a function against a set of test cases and log the results.
/**
* @param {function} fn The function to test.
* @param {Object} cases An object mapping input values (as keys) to expected output (as values).
*/
export function testAssertEqual(fn, cases) {
console.log("Testing:", fn.name || "fn");
let ok = 0;
let total = Object.keys(cases).length;
for (const k in cases) {
@rahuldhole
rahuldhole / xrdp.nix
Created November 11, 2025 00:11
wip: Nix server xrdp on idx
pkgs.xorg.xorgserver
pkgs.xorg.xrandr
pkgs.xorg.xsetroot
pkgs.xterm
pkgs.xorg.xinit
pkgs.hexdump
pkgs.openbox
pkgs.openssh
---