Skip to content

Instantly share code, notes, and snippets.

View denizzzka's full-sized avatar

Denis Feklushkin denizzzka

View GitHub Profile
@DannyArends
DannyArends / microGPT.d
Created February 21, 2026 10:51
Andrej Karpathy's microgpt.py translated into the D programming language
/*
The most atomic way to train and run inference for a GPT in pure, dependency-free D.
This file is the complete algorithm,
Everything else is just efficiency.
@karpathy
Translation by @DannyArends
*/
import std.algorithm : countUntil, fold, joiner, map, maxElement, min, sort, sum, uniq;
@karpathy
karpathy / microgpt.py
Last active February 22, 2026 12:29
microgpt
"""
The most atomic way to train and run inference for 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
@xdsopl
xdsopl / pdm.c
Created December 29, 2021 13:05
PDM MEMS microphone to 16 bit at 16 kHz PCM using a 2 MHz crystal oscillator and a logic analyzer
/*
2 MHz clock goes to the PDM MEMS microphone and channel 0 of the logic analyzer.
The logic analyzer needs at least a 6 MHz sample rate or three times the clock rate.
Data signal from the microphone goes to channel 4 of the logic analyzer.
Tested using a MP34DT01-M with select connected to ground.
compile:
gcc -Ofast -Wall -o pdm pdm.c
stream to speakers:
@veelo
veelo / howto.md
Last active September 27, 2018 01:03
ddox on Travis CI

Serve ddox documentation on github.io deployed by Travis CI

This guide makes no assumptions on prior knowledge of Github Pages or Travis CI. You'll know which steps to skip (if the project uses Pages already, this will overwrite them). Assumed is you have a public D project on GitHub and you have documented its API with embedded ddoc comments. You should probably be aware of the known issues of ddox, which we use here.

For a project URL like https://github.com/<user>/<project>, the documentation will appear at https://<user>.github.io/<project>/.

Enable Travis CI for your repository

The long story: https://docs.travis-ci.com/user/getting-started/, https://docs.travis-ci.com/user/languages/d/

The short story:

@gabonator
gabonator / cc1101oregon.ino
Created May 12, 2016 21:06
Oregon scientific WMR sniffing with CC1101 transceiver using arduino
#include "cc1101.h"
class C1101Receiver : public CC1101
{
enum
{
SS = 10,
MOSI = 11,
MISO = 12,
SCK = 13,
@yurydelendik
yurydelendik / !wasmllvm.md
Last active December 15, 2025 00:33
Using WebAssembly in LLVM

NOTE: the content is out-of-date. All development is moved to the https://github.com/yurydelendik/wasmception

Using WebAssembly in LLVM

Compiling

# locations, e.g.
export WORKDIR=~/llvmwasm; mkdir -p $WORKDIR
export INSTALLDIR=$WORKDIR
@Zardoz89
Zardoz89 / DCPU-24.md
Last active February 12, 2018 09:22
Another CPU based on DCPU-16
layout title cat
default
DCPU-24 CPU
CPU

DCPU-24 Specification

Copyrights 1985 Mojang, Meisaka and zardoz of Trillek

@Meisaka
Meisaka / DCPU-16N.txt
Last active February 9, 2021 18:30
DCPU redesigns
>>>>>>>>
DCPU-16N Instruction Set Architecture Specification
Copyrights 1984 Meisaka Yukara
Version 1.15
=================================== SUMMARY ====================================
* 16 bit CISC CPU design
* DCPU-16 compatibility functions
@jonpovey
jonpovey / spec_1.7_irqs.txt
Created May 6, 2012 03:25
Clarification of interrupt things in DCPU spec 1.7
Clarification of interrupt things in DCPU spec 1.7
A couple of questions, and suggestions.
=== EXECUTIVE SUMMARY ==========================================================
1. Is hardware still notified about triggering of interrupts it has sent to
DCPU? It looks like that feature has been removed (good).
2. Can you clarify that if there are interrupts on queue, after RFI the
interrupt handler is immediately called again? This is the right way to do it