Skip to content

Instantly share code, notes, and snippets.

View darvid's full-sized avatar
πŸŒƒ
πŸ§‘β€πŸš€πŸ’ŠπŸš€

David Gidwani darvid

πŸŒƒ
πŸ§‘β€πŸš€πŸ’ŠπŸš€
View GitHub Profile
"""
The most atomic way to train and run inference for a GPT in pure, dependency-free Python.
This file is the complete algorithm.
Everything else is just efficiency.
@karpathy
"""
import os # os.path.exists
import math # math.log, math.exp
@awni
awni / open_code_mlx.md
Last active March 16, 2026 09:59
OpenCode with MLX

The following guide will show you how to connect a local model served with MLX to OpenCode for local coding.

1. Install OpenCode

curl -fsSL https://opencode.ai/install | bash

2. Install mlx-lm

@rmtbb
rmtbb / listgitfiles.sh
Created September 3, 2025 22:23
List Git Files - List raw GitHub URLs for files in a repo or subfolder, filtered by extensions
#!/usr/bin/env bash
# listgitfiles.sh
# List raw GitHub URLs for files in a repo or subfolder, filtered by extensions.
# Full README is embedded and printed only with: listgitfiles.sh -h|--help
set -euo pipefail
# ------------------------- Minimal Help (usage) -------------------------
print_min_help() {
cat <<'USAGE'
@danhollick
danhollick / tailwind-css-v4.mdc
Last active February 19, 2026 08:35
Cursor rules file for Tailwind CSS v4.0
// Update globs depending on your framework
---
name: tailwind_v4
description: Guide for using Tailwind CSS v4 instead of v3.x
globs: ["**/*.{js,ts,jsx,tsx,mdx,css}"]
tags:
- tailwind
- css
---
@aaronvg
aaronvg / .cursorrules
Created November 26, 2024 02:06
CursorRules for BAML
<Overview>
BAML (Basically, A Made-Up Language) is a domain-specific language for building LLM prompts as functions.
You can build an agentic workflow with BAML.
</Overview>
<Schema>
// Define output schemas using classes
class MyObject {
// Optional string fields use ?
// @description is optional, but if you include it, it goes after the field.
@clouedoc
clouedoc / Migrating from Arc to Zen Browser.md
Created September 20, 2024 08:57
Migrating from Arc to Zen Browser

A guide to leaving Arc for Zen Browser

The problem with Arc is that it doesn't allow exporting data (history, bookmarks) to a file natively.

One way to do this is to use a script but that only exports Bookmarks and not the history.

I don't really use the bookmarks feature that much; what I really liked about Arc was that it was really easy to navigate to somewhere I already visited.

So, if you're like me, follow this guide and you'll be able to import your browsing history into Zen browser!

@dvins
dvins / pnpm-peerdependency-override.md
Last active March 10, 2026 22:21
Overriding A Peer Dependency With PNPM

Overriding A Peer Dependency With PNPM

This guide explains how to override peer dependencies in a PNPM monorepo by using a custom hook. It provides a step-by-step solution to ensure consistent versioning across packages that rely on different versions of the same dependency.

Background

When working with a monorepo a challenges arises if you need to use multiple versions of the same package.

Nominally, this can be solved through package aliases and overides. However, a particularly sticky situation is when downstream packages rely peer dependencies of uptstream packages you need two or more versions of.

@swayducky
swayducky / cursor
Last active February 20, 2026 18:35
This fixes using "cursor" command in WSL
#!/usr/bin/env sh
# LATEST VERSION OF THIS SCRIPT: https://gist.github.com/swayducky/8ba8f2db156c7f445d562cdc12c0ddb4
# FORKED FROM: https://gist.github.com/ddwang/0046da801bcb29d241869d37ad719394
# 1) No longer has a hard-coded COMMIT
# 2) Auto-symlinks a "code" script to avoid wslCode.sh breaking
# HOW TO INSTALL:
# 1) Remove "c:\Users\<USER_NAME>\AppData\Local\Programs\cursor\resources\app\bin" from Windows Environment Settings
# 2) Modify this script with your Windows <USER_NAME> (NOT your WSL username) in the VSCODE_PATH variable
@a-churchill
a-churchill / README.md
Last active August 23, 2025 00:13
Documentation Search in Sanity

Documentation Search in Sanity

This Gist contains a sample query for searching text content in GROQ, Sanity's custom query language. We use something similar to this for Causal's documentation site. See more on our blog!

@adtac
adtac / Dockerfile
Last active December 26, 2025 00:20
#!/usr/bin/env docker run
#!/usr/bin/env -S bash -c "docker run -p 8080:8080 -it --rm \$(docker build --progress plain -f \$0 . 2>&1 | tee /dev/stderr | grep -oP 'sha256:[0-9a-f]*')"
# syntax = docker/dockerfile:1.4.0
FROM node:20
WORKDIR /root
RUN npm install sqlite3