Skip to content

Instantly share code, notes, and snippets.

View arockwell's full-sized avatar

Alex Rockwell arockwell

View GitHub Profile
@arockwell
arockwell / server.js
Created December 12, 2017 20:29
Simple GraphQL proxy
var express = require('express');
var graphqlHTTP = require('express-graphql');
var { buildSchema } = require('graphql');
var fetch = require('node-fetch');
// Construct a schema, using GraphQL schema language
var schema = buildSchema(`
type User {
first_name: String
last_name: String

Keybase proof

I hereby claim:

  • I am arockwell on github.
  • I am alexrockwell (https://keybase.io/alexrockwell) on keybase.
  • I have a public key ASAfWQFL_oX3tYueOlCBe14OrpANgsBgAY2qQUxEL2l67wo

To claim this, I am signing this object:

@arockwell
arockwell / gist:df93e36d53f42d97d8b8c5510e636b1d
Created May 6, 2025 00:47
Improved scientific notation parsing for lexer
// Handle scientific notation (e.g., 1.23e45 or 1e-10)
} else if grapheme == "e" || grapheme == "E" {
if is_scientific {
self.errors.push(LexError::new(
graphemes.concat(),
self.line,
self.column,
"number may not contain multiple exponential parts".to_owned(),
));
return;
@arockwell
arockwell / gist:5ce76c4f464f8c2c299ef4a62b72ef56
Created May 6, 2025 00:51
Complete refactor of number parsing for lexer - mega-mind edition
// BEFORE: Complex, nested conditionals with inconsistent flow
// AFTER: State machine approach with clear phases
fn number(&mut self, graphemes: &[&str]) {
let token_col = self.column - 2;
let mut number = graphemes[self.column - 2].to_string();
// Use an enum to track parsing state
enum NumberState {
Digits, // Consuming integer digits
@arockwell
arockwell / gist:a6e450a1d60b99fb6c4494b6635645b9
Created May 6, 2025 00:52
Improved number parsing - balanced approach
fn number(&mut self, graphemes: &[&str]) {
let token_col = self.column - 2;
let mut is_float = false;
let mut number = graphemes[self.column - 2].to_string();
// Part 1: Handle integer part (required)
while self.consume_digits(&mut number, graphemes) {}
// Part 2: Handle decimal part (optional)
if self.column - 1 < graphemes.len() && graphemes[self.column - 1] == "." {
@arockwell
arockwell / hello_world.py
Created May 25, 2025 07:50
Snazzy Hello World
#!/usr/bin/env python3
"""
Hello World v2.0 - Now with 100% more snazz! ✨
"""
import random
import time
from datetime import datetime
def typewriter_effect(text, delay=0.05):
@arockwell
arockwell / claude-knowledge-gist.md
Created July 4, 2025 05:54
PostgreSQL Knowledge Base for Millions of Markdown Files - A blazing-fast document management system with Fish shell

PostgreSQL Knowledge Base for Millions of Markdown Files

A blazing-fast markdown document management system built with PostgreSQL and Fish shell. Handles everything from personal notes to millions of documents with smart tab completion and beautiful mdcat rendering.

Features

  • 🚀 Scales to millions - Optimized indexes, parallel queries, batch operations
  • 🔍 Full-text + Fuzzy search - PostgreSQL FTS with trigram support
  • 📁 Project organization - Group documents by project with multi-level tab completion
  • Sub-second queries - Even with millions of documents
@arockwell
arockwell / tmpjkva85r5.md
Created July 8, 2025 06:43
Test public gist from emdx

emdx - Documentation Index Management System

A powerful command-line tool for managing your personal knowledge base with SQLite full-text search, Git integration, and a beautiful terminal interface.

Features

  • 🚀 Unified CLI: Single emdx command with intuitive subcommands
  • 🔍 Full-Text Search: SQLite FTS5-powered search with ranking and fuzzy matching
  • 📝 Multiple Input Methods: Save files, create notes, pipe output, or paste from clipboard
  • 🎨 Rich Terminal UI: Beautiful tables, markdown rendering, and syntax highlighting
@arockwell
arockwell / tmp6v1sx5ua.md
Created July 13, 2025 07:27
EMDX Background Jobs: Complete Implementation Guide - Architecture for async job execution with integrated log viewer

Building Background Execution + Log Viewer into EMDX

Implementation Roadmap

Phase 1: Core Infrastructure

1.1 Job Management System

# emdx/models/jobs.py
from dataclasses import dataclass
@arockwell
arockwell / tmp20borr7y.md
Created July 13, 2025 07:28
EMDX Tmux Integration: Next Steps Analysis - Ideas for extending tmux pane spawning functionality
tmux_command = f"claude-code --file {temp_path}"
tags = get_document_tags(doc_id)
if '🎯' in tags:  # Gameplan
    tmux_command = f"claude-code --execute-plan {temp_path}"
elif '🔍' in tags:  # Analysis
    tmux_command = f"claude-code --analyze {temp_path}"