Skip to content

Instantly share code, notes, and snippets.

View alehatsman's full-sized avatar
🐶

Aleh Atsman alehatsman

🐶
View GitHub Profile

dex — Capability Showcase

What this document shows. Three real queries against the dex codebase itself, run twice: once with no GPU or LLM services available, once with the full stack (embeddings + reranker + chat model). Every output below is grounded in the actual source files, field names, and line numbers of this repo.


The core problem dex solves

@alehatsman
alehatsman / pipe.md
Created June 4, 2026 11:43
pipe.md

Now I have everything. Here's the full pipeline from the source.


Full data pipeline — from source file to answer

1. Chunking — internal/chunk/chunk.go

Entry point: chunk.Chunks(ctx, relPath, data []byte) ([]Chunk, error)

@alehatsman
alehatsman / claude_autoapprove.py
Created February 5, 2026 09:48
claude_autoapprove.py
#!/usr/bin/env python3
"""
Claude Code Auto-Approve Wrapper
This wrapper starts Claude Code and:
- Auto-approves permission prompts after a 5-second countdown
- Presents actual user questions for real input
- Allows normal typing into the input box
"""
export default function bfs(head: BinaryNode<number>, needle: number): boolean {
return walk([head], needle);
}
function walk(queue: BinaryNode<number>[], needle: number): boolean {
const node = queue.shift();
if (!node) {
return false;
}
@alehatsman
alehatsman / snowflake_access.clj
Last active November 2, 2021 14:56
snowflake clojure access
;{:paths ["src"]
; :deps
; {org.clojure/clojure {:mvn/version "1.10.3"}
; com.github.seancorfield/next.jdbc {:mvn/version "1.2.674"}
; net.snowflake/snowflake-jdbc {:mvn/version "3.13.9"}}}
(ns main
(:require [next.jdbc :as jdbc]
[clojure.string :as string]))
@alehatsman
alehatsman / deps.edn
Created August 13, 2020 09:28 — forked from pyrmont/deps.edn
Figwheel setup with Conjure
{:deps {org.clojure/clojure {:mvn/version "1.10.1"}
org.clojure/clojurescript {:mvn/version "1.10.597"}}
:paths ["src" "resources"]
:aliases {:fig {:extra-deps
{com.bhauman/rebel-readline-cljs {:mvn/version "0.1.4"}
com.bhauman/figwheel-main {:mvn/version "0.2.4"}}
:extra-paths ["target" "test"]}
:build {:main-opts ["-m" "figwheel.main" "-b" "dev" "-r"]}
:min {:main-opts ["-m" "figwheel.main" "-O" "advanced" "-bo" "dev"]}
:release {:main-opts ["-m" "figwheel.main" "-bo" "release"]}
@alehatsman
alehatsman / colorscheme-override.md
Created April 24, 2020 08:53 — forked from romainl/colorscheme-override.md
The right way to override any highlighting if you don't want to edit the colorscheme file directly

The right way to override any highlighting if you don't want to edit the colorscheme file directly

Suppose you have weird taste and you absolutely want:

  • your visual selection to always have a green background and black foreground,
  • your active statusline to always have a white background and red foreground,
  • your very own deep blue background.

Your first reflex is probably to put those lines somewhere in your vimrc:

FWIW: I didn't produce the content presented here (the outline from Edmond Lau's book). I've just copy-pasted it from somewhere over the Internet, but I cannot remember what exactly the original source is. I was also not able to find the author's name, so I cannot give him/her the proper credits.


Effective Engineer - Notes

What's an Effective Engineer?

@alehatsman
alehatsman / async.cljs
Created August 8, 2018 09:55
ClojureScript throttle and debouce functions
(ns async
(:import [goog.async Throttle Debouncer]))
(defn disposable->function [disposable listener interval]
(let [disposable-instance (disposable. listener interval)]
(fn [& args]
(.apply (.-fire disposable-instance) disposable-instance (to-array args)))))
(defn throttle [listener interval]
(disposable->function Throttle listener interval))
@alehatsman
alehatsman / Aleph get json
Created July 28, 2017 11:22
Aleph http client get request and parse body from json to clojure map.
(require '[aleph.http :as http]
'[byte-streams :as bs]
'[cheshire.core :as cheshire]
'[manifold.deferred :as d])
(defn input-stream-to-buffered-reader [is]
(new BufferedReader (new InputStreamReader is)))
(defn parse-json-input-stream [is]
(-> (input-stream-to-buffered-reader is)