Skip to content

Instantly share code, notes, and snippets.

View cometkim's full-sized avatar

Hyeseong Kim cometkim

View GitHub Profile
@quad
quad / 0-modular-errors-with-rusts-thiserror.md
Last active April 16, 2025 06:18
Modular Errors with Rust's thiserror

I've been writing Rust full-time with a small team for over a year now. Throughout, I've lamented the lack of clear best practices around defining error types. One day, I'd love to write up my journey and enumerate the various strategies I've both seen and tried. Today is not that day.

Today, I want to reply to a blog post that almost perfectly summarised my current practice.

Go read it; I'll wait!


@cristianoc
cristianoc / UntaggedUnionsReScript.md
Last active January 1, 2024 23:39
Untagged Union Proposal for ReScript

Untagged Variants Proposal for ReScript

Introduction

  • Brief introduction to ReScript
  • Motivation for untagged variants
  • High-level overview of the proposal

Detailed Design

This for loop:

for (let i = 0, getI = () => i; i < 3; i++)
  console.log(getI());

unrolls to:

@belm0
belm0 / article_sc_and_lua_1.md
Last active October 23, 2024 18:04
Structured concurrency and Lua (part 1)

Structured concurrency and Lua (part 1)

John Belmonte, 2022-Sep

I've started writing a toy structured concurrency implementation for the Lua programming language. Some motivations:

  • use it as a simple introduction to structured concurrency from the perspective of Lua (this article)
  • learn the fundamental properties of structured concurrency and how to implement them
  • share code that could become the starting point for a real Lua library and framework

So what is structured concurrency? For now, I'll just say that it's a programming paradigm that makes managing concurrency (arguably the hardest problem of computer science) an order of magnitude easier in many contexts. It achieves this in ways that seem subtle to us—clearly so, since its utility didn't reach critical mass until around 2018[^sc_birth] (just as control structures like functions, if, and while weren't introduced to languages until long after the first compu

@CodingKoopa
CodingKoopa / apt.md
Last active April 16, 2025 10:16
APT Repositories Explained

Intro

To install and update packages on Debian, Ubuntu, or most derived distributions, you use APT, the Advanced packaging tool, to download the packages and their dependencies, which uses dpkg to install them.

These notes go into the downloading part, as I think it's easy to get overwhelmed by how the repositories work. I will eventually turn this into a page on my website.

Repository

A repository is where the packages come from. It provides binary packages for an arbitrary selection of architectures as well as source packages. Repositories are APT's data source. [https://wiki.debian.org/DebianRepository]

@antfu
antfu / doc-table.md
Last active October 14, 2023 20:09
Doc Table in Markdown

Example

Name

Description


@lifthrasiir
lifthrasiir / dj40.c
Last active September 13, 2022 16:42
Pre-release version of J40 JPEG XL decoder, see https://github.com/lifthrasiir/j40 for recent releases
#define J40_CONFIRM_THAT_THIS_IS_EXPERIMENTAL_AND_POTENTIALLY_UNSAFE
#define J40_IMPLEMENTATION
#include "j40.h"
#ifdef __GNUC__ // stb_image_write issues too many warnings
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wconversion"
#endif
#define STB_IMAGE_WRITE_IMPLEMENTATION
@Gikkman
Gikkman / 00 - Overview
Last active March 19, 2025 09:18
Git spare-checkout with nested submodules
We got a root project (project-a) which has a submodule (project-b). That submodule in turn has a submodule (project-c).
Each project also contains some files.
project-a @ 5r210h6/
├─ some-file.a
├─ other-file.a
├─ third-file.a
├─ project-b @ 196a095/
│ ├─ some-file.b
| ├─ more-file.b
@steida
steida / createTypedWorker.ts
Created February 10, 2022 23:27
Typed Web Worker
/**
* Typed Web Worker.
*
* type InputData = { name: string };
* type OutputData = { nameLength: number }
*
* // main.js
* const worker = createTypedWorker<InputData, OutputData>(worker);
*
* // worker.js
@joelonsql
joelonsql / PostgreSQL-EXTENSIONs.md
Last active April 17, 2025 05:24
1000+ PostgreSQL EXTENSIONs

🗺🐘 1000+ PostgreSQL EXTENSIONs

This is a list of URLs to PostgreSQL EXTENSION repos, listed in alphabetical order of parent repo, with active forks listed under each parent.

⭐️ >= 10 stars
⭐️⭐️ >= 100 stars
⭐️⭐️⭐️ >= 1000 stars
Numbers of stars might not be up-to-date.