Skip to content

Instantly share code, notes, and snippets.

View saiashirwad's full-sized avatar
🏠
beep beep boop boop

texoport saiashirwad

🏠
beep beep boop boop
View GitHub Profile
@saiashirwad
saiashirwad / config.fish
Created June 20, 2026 08:04
glm claude code
function glm
env ANTHROPIC_BASE_URL="https://api.z.ai/api/anthropic" \
ANTHROPIC_AUTH_TOKEN="$ZAI_API_KEY" \
ANTHROPIC_DEFAULT_OPUS_MODEL="glm-5.2" \
ANTHROPIC_DEFAULT_SONNET_MODEL="glm-5.2" \
ANTHROPIC_DEFAULT_HAIKU_MODEL="glm-4.7" \
claude $argv --dangerously-skip-permissions
end
@saiashirwad
saiashirwad / effect-pure-policy-refactoring-guide.md
Created March 25, 2026 18:32
Guide: Pure Policy ADT Extraction (Functional Core, Imperative Shell) in Effect

Guide: Pure Policy ADT Extraction (Functional Core, Imperative Shell) in Effect

This document details the exact steps an agent must follow to refactor a complex Effect-based orchestrator or worker into the "Functional Core, Imperative Shell" pattern.

1. Context & Goal

Many workers organically grow into a messy, interleaved mix of:

  • I/O & Side Effects: yield* db.findUnique, yield* fetch(...), yield* Effect.logInfo,
@saiashirwad
saiashirwad / test-gist.txt
Created February 16, 2026 15:02
test gist
test gist
@saiashirwad
saiashirwad / agent loop
Created December 30, 2025 12:22 — forked from jlia0/agent loop
Manus tools and prompts
You are Manus, an AI agent created by the Manus team.
You excel at the following tasks:
1. Information gathering, fact-checking, and documentation
2. Data processing, analysis, and visualization
3. Writing multi-chapter articles and in-depth research reports
4. Creating websites, applications, and tools
5. Using programming to solve various problems beyond development
6. Various tasks that can be accomplished using computers and the internet
{"name":"default","settings":"{\"settings\":\"{\\n \\\"[json]\\\": {\\n \\\"editor.defaultFormatter\\\": \\\"vscode.json-language-features\\\",\\n \\\"editor.quickSuggestions\\\": {\\n \\\"strings\\\": true\\n },\\n \\\"editor.tabSize\\\": 2\\n },\\n \\\"[jsonc]\\\": {\\n \\\"editor.defaultFormatter\\\": \\\"vscode.json-language-features\\\",\\n \\\"editor.quickSuggestions\\\": {\\n \\\"strings\\\": true\\n },\\n \\\"editor.tabSize\\\": 2\\n },\\n \\\"editor.inlineSuggest.enabled\\\": true,\\n \\\"[typescript]\\\": {\\n \\\"editor.defaultFormatter\\\": \\\"esbenp.prettier-vscode\\\",\\n \\\"editor.tabSize\\\": 2\\n },\\n \\\"[typescriptreact]\\\": {\\n \\\"editor.defaultFormatter\\\": \\\"esbenp.prettier-vscode\\\"\\n },\\n \\\"editor.accessibilitySupport\\\": \\\"off\\\",\\n \\\"editor.formatOnSave\\\": true,\\n \\\"editor.lineNumbers\\\": \\\"relative\\\",\\n \\\"editor.mouseWheelZoom\\\": false,\\n \\\"editor.quickSuggestions\\\": {\\n \\\"strings
@saiashirwad
saiashirwad / js-parser.ts
Created June 4, 2025 17:54
a parser for a simple js-like language (mostly written by claude sonnet 4) using parserator
import {
atomic,
between,
char,
commit,
Either,
eof,
ErrorFormatter,
many,
optional,

Mazha: A Reactive TypeScript Notebook

1. Core Objective & "North Star"

  • Objective: To provide a reactive notebook environment specifically designed for TypeScript, enabling users to create and manage notebooks programmatically, with a strong emphasis on type safety and developer experience.
  • "North Star" - Deep Project Integration: Mazha's primary differentiator is its deep, native integration with a user's existing TypeScript project environment. This is paramount.
    • tsconfig.json Adherence: Mazha's backend (for execution and module resolution) and frontend (for client-side LSP) will strictly respect the project's tsconfig.json, including paths, baseUrl, compilerOptions, jsxImportSource, etc., ensuring consistent behavior with the rest of the user's project.
  • Seamless Local Imports: Users can import modules, functions, types, and React components directly from their local project files (e.g., ./src/utils, ../components/MyWidget) into Mazha cells, with full t
Objective: To collaboratively build an extensive and deep understanding of a topic, project, problem, or any subject you wish to explore, starting with minimal initial information.
Your Role (LLM): Act as an Expert Inquisitor and Context Synthesizer. Your primary function is not to provide answers initially, but to ask insightful, targeted questions to systematically elicit all necessary information from me (the user). You are building a comprehensive knowledge base about the subject, piece by piece, driven by your questions.
Process:

Let me try a completely different approach then. Let's bypass Conform and use Neovim's built-in functions to run a formatter directly on the TypeScript code:

vim.api.nvim_create_user_command('FormatTSMarkdown', function()
  -- Save cursor position
  local cursor_pos = vim.api.nvim_win_get_cursor(0)
  local bufnr = vim.api.nvim_get_current_buf()
  
  -- Find TypeScript code blocks
  local lines = vim.api.nvim_buf_get_lines(bufnr, 0, -1, false)
-- Function to collect all diagnostic errors and copy them to clipboard
local function copy_errors_to_clipboard()
-- Get the current buffer number
local current_buf = vim.api.nvim_get_current_buf()
-- Get all diagnostics for the current buffer
local diagnostics = vim.diagnostic.get(current_buf)
-- Format each diagnostic into readable lines
local lines = {}