Skip to content

Instantly share code, notes, and snippets.

@awni
awni / rlm.py
Created February 21, 2026 16:08
LM with a REPL
"""
An LM with a REPL
Gives an LLM a Python REPL: the model can write ```repl``` code blocks,
which get executed, with stdout/stderr fed back into the conversation.
Requires a running mlx_lm.server:
mlx_lm.server
"""
@4eveRS
4eveRS / index.html
Created November 6, 2018 19:45
Electron Fiddle Gist
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
</head>
<body>
<webview id="foo" src="https://googlechrome.github.io/samples/web-bluetooth/device-info.html?allDevices=true" style="display:inline-flex; width:640px; height:480px"></webview>
<script>
// You can also require other files to run in this process
@billstclair
billstclair / elm-compiler-build.md
Last active September 29, 2023 06:07
How to build the Elm 0.19 executable from Haskell source
@rlefevre
rlefevre / elm-linux-x64-static-0.19.0.md
Last active October 29, 2019 14:22
How to build an elm 0.19.0 binary statically linked to musl libc using docker

Elm 0.19.0 Linux x64 statically linked binary

This document describes how to build a statically linked binary of Elm 0.19.0 for Linux x64 using docker. The binary is built using Alpine Linux in order to easily link it statically to musl libc. This is how the official Elm 0.19.0 Linux binary was built.

Why?

Why build a statically linked binary?

Elm is currently distributed using npm. For Linux x64 (but this applies to any architecture), this requires to have a single x64 binary that works on all Linux x64 distributions. This is considerably easier to achieve by building a statically linked binary that will only depend on the Linux kernel ABI and System Call Interface but not on userpace libraries (see here for a compatibility survey of a dynamically built executable).

Why use docker?

@3n21c0
3n21c0 / main.go
Last active April 20, 2026 19:56
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@apokalyptik
apokalyptik / debian-jessie-kubernetes-1.3-manual-install-guide.md
Last active November 21, 2023 12:31
Set up Kubernetes on 3 Debian Jessie virtual machines -- No magic

The Goal

Set up Kubernetes on 3 Debian Jessie virtual machines: One master. Two nodes. Additionally do this without any "magic" so that what is required to be running to make everything work is plain and obvious.

We will be using flannel for the inter-machine networking layer. Mainly because it is useful and it seems to be pretty popular.

The Setup

@joshdover
joshdover / README.md
Last active September 28, 2023 21:38
Idiomatic React Testing Patterns

Idiomatic React Testing Patterns

Testing React components seems simple at first. Then you need to test something that isn't a pure interaction and things seem to break down. These 4 patterns should help you write readable, flexible tests for the type of component you are testing.

Setup

I recommend doing all setup in the most functional way possible. If you can avoid it, don't set variables in a beforeEach. This will help ensure tests are isolated and make things a bit easier to reason about. I use a pattern that gives great defaults for each test example but allows every example to override props when needed:

//EXAMPLE evolution.scala
import java.io.{File, FilenameFilter}
import com.datastax.driver.core.Session
import org.apache.commons.io.filefilter.SuffixFileFilter
import org.joda.time.{DateTime, DateTimeZone}
import play.api.Play.current
import play.api.{Logger, Play}