Skip to content

Instantly share code, notes, and snippets.

View monad-one's full-sized avatar
🌐

monad-one

🌐
  • India
View GitHub Profile
@monad-one
monad-one / yellow.asm
Created November 2, 2025 11:04 — forked from nicolas17/yellow.asm
hello-world iOS app
.global _main
.extern _putchar
.align 4
_main:
; prolog; save fp,lr,x19
stp x29, x30, [sp, #-0x20]!
str x19, [sp, #0x10]

20 million digits of pi in under a minute with Julia

I recently discovered a relatively obscure algorithm for calculating the digits of pi: https://en.wikipedia.org/wiki/Gauss–Legendre_algorithm. Well, at least obscure compared to Chudnovsky's. Wikipedia notes that it is "memory-intensive" but is it really? Let's compare to the MPFR pi function:

function gauss_legendre(prec)
    setprecision(BigFloat, prec, base=10)
    GC.enable(false)
@monad-one
monad-one / chatgpt_parser.py
Created December 4, 2022 06:01 — forked from thomasantony/chatgpt_parser_md.py
Convert saved HTML transcripts from ChatGPT to Markdown
# Save the transcripts using the "Save Page WE" Chrome Extension
# This script was generated by ChatGPT
import sys
from bs4 import BeautifulSoup
# Check if a file was provided as a command line argument
if len(sys.argv) < 2:
print("Please provide an HTML file as a command line argument.")
sys.exit(1)
@monad-one
monad-one / 55-bytes-of-css.md
Created September 26, 2022 07:44 — forked from JoeyBurzynski/55-bytes-of-css.md
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@monad-one
monad-one / fork-is-evil-vfork-is-good-afork-would-be-better.md
Created March 1, 2022 04:07 — forked from nicowilliams/fork-is-evil-vfork-is-good-afork-would-be-better.md
fork() is evil; vfork() is goodness; afork() would be better; clone() is stupid

I recently happened upon an implementation of popen() (different API, same idea) using clone(2), and so I opened an issue requesting use of vfork(2) or posix_spawn() for portability. It turns out that on Linux there's an important advantage to using clone(2). I think I should capture the things I wrote there in a better place. A gist, a blog, whatever.

So here goes.

Long ago, I, like many Unix fans, thought that fork(2) and the fork-exec process spawning model were the greatest thing, and the Windows sucked for only having [exec*()](http://pubs.opengroup.org/onlinepubs/9699919

@monad-one
monad-one / gym.py
Created September 29, 2021 03:13 — forked from Alir3z4/gym.py
import os
import pickle
import warnings
import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
from tensorflow.keras.callbacks import EarlyStopping
from tensorflow.keras.layers import Dense
from tensorflow.keras.layers import Dropout
@monad-one
monad-one / ffmpeg.md
Created April 25, 2021 03:19 — forked from steven2358/ffmpeg.md
FFmpeg cheat sheet
@monad-one
monad-one / System Design.md
Created April 17, 2021 05:31 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@monad-one
monad-one / 1001-albums
Created April 15, 2021 15:40 — forked from tatygrassini/1001-albums
1001 Albums You Must Hear Before You Die
1001 Albums You Must Hear Before You Die
List taken from then book edited by Robert Dimery.
Missing from the list:
Machito - Kenya 1957
Jack Elliot - Jack Takes The Floor 1958
Dolly Parton - Coat Of Mahy Colors 1971
George Jones - The Grand Tour 1974
R.D. Burman / Bappi Lahiri - Shalimar / College Girl 1975