Skip to content

Instantly share code, notes, and snippets.

View shreyassanthu77's full-sized avatar

Shreyas Mididoddi shreyassanthu77

View GitHub Profile
@shreyassanthu77
shreyassanthu77 / parser.ts
Created January 4, 2025 16:56
ts function extraction using tree sitter
import Parser from "npm:tree-sitter";
import treeSitterTypescript from "npm:tree-sitter-typescript";
const code = `
/**
* This is a doc comment
*
* alsdkfjlkj
*/
function foo(a: A): void;
@shreyassanthu77
shreyassanthu77 / xml.zig
Last active August 26, 2025 00:12
A very minimal and dumb xml parser written in zig
const std = @import("std");
const Self = @This();
source: [:0]const u8,
pos: usize = 0,
state: State = .start,
pub fn next(self: *Self) !Token {
var start = self.pos;
var text_end: usize = 0;
@shreyassanthu77
shreyassanthu77 / sql-proxy.ts
Created January 29, 2026 16:03
sql proxy? no idea if this works well but seems like it's good enough?
import { createClient, type Client, type InArgs } from "@libsql/client/node";
import { getPort } from "get-port-please";
import * as devalue from "devalue";
export class SqlProxy {
#initPromise: Promise<void>;
#state!:
| {
kind: "server";
s: Deno.HttpServer;
@shreyassanthu77
shreyassanthu77 / AGENTS.md
Created July 25, 2026 00:52
my agents file as of july 2026

Package management

ALWAYS use pnpm for package management.

pnpm add <package>
pnpm dlx <executable> # e.g. pnpm dlx drizzle-kit
pnpm <task> # e.g. pnpm check, pnpm format etc.