Skip to content

Instantly share code, notes, and snippets.

View latrokles's full-sized avatar
🧗‍♂️
🏐 💻

latrokles latrokles

🧗‍♂️
🏐 💻
  • Seattle
  • 20:47 (UTC -07:00)
View GitHub Profile
@divs1210
divs1210 / stackless-eval.md
Last active April 22, 2024 01:58
Writing a Stackless Evaluator

Writing a Stackless Evaluator

Divyansh Prakash, September 2023

tiny-stackless-eval

Preface

NOTE: Please read the previous post to understand the context of this post.

@jackrusher
jackrusher / webdav.clj
Last active November 1, 2023 22:07
A minimal webdav server/synthetic filesystem that works with JVM Clojure and babashka. See comments for instructions!
(ns webdav
(:require [clojure.string :as str]
[clojure.data.xml :as xml]
[org.httpkit.server :as hk-server]))
;; add the XML namespace that we'll use later
(xml/alias-uri 'd "DAV:")
(defn dissoc-in
"Should be in the standard library..."
@rain-1
rain-1 / 0-MNIST.md
Last active March 25, 2023 03:41
MNIST digit classification

MNIST digit recognition

The pytorch (neural network library) examples include a script to try out the training process for MNIST digit recognition data set: https://github.com/pytorch/examples/tree/main/mnist

This builds up a convolutional neural network that takes one of these pictures and processes it down to 10 neurons. The training process uses two sets of labelled data (examples of pictures of digits and which of the 10 possible digits they are): One training set and one testing set. The training set is used to manipulate all of the "weights" inside the neural network by moving in the (very high dimensional) direction of fastest descent, aiming to get the output neurons to produce the intended label given the input picture. The testing set is used as a metric to say how well the neural network is doing.

I ran this, creating mnist_cnn.pt with 99% accuracy on the test data set.

Then I wanted to see if it worked, so I drew images of all 10 digits. There was no way to try this out so I wrote the attach

@reednj
reednj / mult.md
Last active September 25, 2022 06:23

Multiplication from Scratch

Imagine you need to implement (integer) mulitplication in code. Maybe you are on a system which doesn't have it or something. How to do this, and what is the minimal set of operators that are required?

Repeated addition

The most obvious way to do multiplition is through repeated addition. To get the answer to 56 x 67 you add 56 to itself 67 times (or 67, 56 times - the order doesn't matter).

This is simple to implement if we assume for the moment that both a and b are positive (we will deal with negative integers later)

@raysan5
raysan5 / raylib_vs_sdl.md
Last active April 27, 2024 13:53
raylib vs SDL - A libraries comparison

raylib_vs_sdl

In the last years I've been asked multiple times about the comparison between raylib and SDL libraries. Unfortunately, my experience with SDL was quite limited so I couldn't provide a good comparison. In the last two years I've learned about SDL and used it to teach at University so I feel that now I can provide a good comparison between both.

Hope it helps future users to better understand this two libraries internals and functionality.

Table of Content

@mrnugget
mrnugget / tucan_bibliography.md
Last active February 21, 2024 15:42
Tucan Bibliography. Majority of the resources I used to build Tucan, my toy optimizing compiler in Rust

Tucan - Bibliography

Majority of the resources I used to build Tucan, my toy optimizing compiler in Rust. This list is not complete but most of the things listed here are things I really read through and used.

Books

  • Engineering a compiler (I use this a lot! For SSA, dominance and optimizations)
  • [Static Single Assignment Book][ssabook] (I use this a lot!)
  • Types And Programming Languages
@lukego
lukego / 0README.md
Last active June 15, 2023 19:03
CLIME installation instructions
@snej
snej / tails.cc
Last active May 8, 2021 18:27
Tails! A tiny Forth core written as a hack for May Forth 2021, using some of Wasm3's secret optimization sauce.
// Tails has grown a bit and moved out into its own repository: https://github.com/snej/tails/
// Please visit it there!
//
// If you want to see the tiny original version from May Forth 2021, it's still here;
// click the "Revisions" button above, or go to:
// https://gist.github.com/snej/9ba59d90689843b22dc5be2730ef0d49/2d55f844b7622aa117b9275bbc9d189613f7ff7f
@jackrusher
jackrusher / trinity.js
Created March 29, 2021 09:23
A fast, minimal JS triple store implementation in ~70 lines of code
// three indices to efficiently support all lookups
function createDB() {
return {eav: new Map(),
ave: new Map(),
vea: new Map()};
}
function addToIndex(xs, x, y, z, triple) {
let ys = xs.get(x);
if(ys == undefined) {
@ityonemo
ityonemo / test.md
Last active May 1, 2024 15:37
Zig in 30 minutes

A half-hour to learn Zig

This is inspired by https://fasterthanli.me/blog/2020/a-half-hour-to-learn-rust/

Basics

the command zig run my_code.zig will compile and immediately run your Zig program. Each of these cells contains a zig program that you can try to run (some of them contain compile-time errors that you can comment out to play with)