Skip to content

Instantly share code, notes, and snippets.

@micha
micha / microgpt.py
Created February 12, 2026 05:17 — forked from karpathy/microgpt.py
microgpt
"""
The most atomic way to train and inference 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
@micha
micha / dates.cljc
Created April 13, 2016 11:58 — forked from Deraen/dates.cljc
Cljc dates
(ns metosin.dates
"Use this namespace to format dates and datetimes for user.
Don't use for serializing or deserializing.
Clojure side uses always Helsinki timezone.
On Cljs side, uses the timezone of browser."
#?(:cljs (:require goog.date.UtcDateTime
goog.date.Date
goog.i18n.DateTimeFormat))
#?(:clj (:import [org.joda.time DateTimeZone])))
@micha
micha / client.cljs
Last active September 29, 2015 19:12 — forked from bsima/client.cljs
(ns bio.nebula.client
"State handler for all of the client-side stuff."
(:require-macros [javelin.core :refer [defc defc= cell=]]
[hoplon.core :refer [loop-tpl defelem]])
(:require
[javelin.core :as j :refer [cell]]
[castra.core :as c :refer [mkremote]]
[hoplon.core :as h]))
;; card component state
@micha
micha / test.clj
Last active August 29, 2015 14:24 — forked from burn2delete/test.clj
(boot/deftask yaml-to-json
"Convert YAML file to JSON."
[]
(let [tmp (boot/tmp-dir!)]
(comp (boot/with-pre-wrap fileset
(doseq [f (->> fileset boot/input-files)]
(let [in-file (tmpd/file f)
in-path (tmpd/path f)
out-path (change-file-ext in-path "json")
out-file (io/file tmp out-path)
(page "test.html")
(defc working-set [])
(def indexed (partial map-indexed list))
(defn setup-working-set
"Initially populate the working set - normally the res"
[data]
(let [wset (map (fn [c] [c false]) data)]
;; -*- mode: clojure; -*-
(set-env!
:src-paths #{"src/clj" "src/cljs"}
:rsc-paths #{"resources"}
:update :always
:dependencies '[[org.clojure/clojure "1.7.0-alpha4"]
[org.clojure/core.async "0.1.346.0-17112a-alpha"]
[com.taoensso/timbre "3.3.1-1cd4b70"]
[http-kit "2.1.19"]