Skip to content

Instantly share code, notes, and snippets.

@jgreely
jgreely / smartdown.sh
Created September 5, 2021 06:28
Bash script to convert Hugo markdown files to smartquotes, since Goldmark sucks at it
#!/usr/bin/env bash
#
# add smart quotes to Hugo Markdown source files, using the
# reference implementation of CommonMark's CLI tool:
# https://github.com/commonmark/commonmark-spec
# Notes:
# - assumes TOML front matter
# - converts footnote-style links to inline
# - normalizes ordered/unordered list formatting
#
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@kassane
kassane / sieve-cache.md
Last active May 21, 2024 03:31
About SIEVE-cache :en:

Original post: kubo39/gist 🇯🇵


About SIEVE Cache

A cache algorithm called [SIEVE][sieve-website] was announced in 2023. It claims to be simpler than LRU, and indeed it is a fairly simple algorithm, but it is said to perform as well as existing superior cache algorithms such as S3-FIFO and TinyLFU.

@hyun007
hyun007 / span.io-api-documentation.md
Last active May 21, 2024 03:30
span.io api documentation

Span.io API Documentation

The Span API does not at this time require any authentication. This will probably change in the future.

Description: Gets panel summary, firmware version, door state, serial number, network status Request: GET /api/v1/status Response:

{
  "software": {
    "firmwareVersion": "spanos2/r202216/04",
Email: 982092332@qq.com
SN: GAWAE-FCWQ3-P8NYB-C7GF7-NEDRT-Q5DTB-MFZG6-6NEQC-CRMUD-8MZ2K-66SRB-SU8EW-EDLZ9-TGH3S-8SGA
@veekaybee
veekaybee / normcore-llm.md
Last active May 21, 2024 03:25
Normcore LLM Reads

Anti-hype LLM reading list

Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.

Foundational Concepts

Screenshot 2023-12-18 at 10 40 27 PM

Pre-Transformer Models

@lbruder
lbruder / lbForth.c
Created April 6, 2014 15:21
A minimal Forth compiler in ANSI C
/*******************************************************************************
*
* A minimal Forth compiler in C
* By Leif Bruder <leifbruder@gmail.com> http://defineanswer42.wordpress.com
* Release 2014-04-04
*
* Based on Richard W.M. Jones' excellent Jonesforth sources/tutorial
*
* PUBLIC DOMAIN
*
@jniltinho
jniltinho / install-buildkit.sh
Last active May 21, 2024 03:19
Enable BuildKit Docker Ubuntu 22.04
#!/bin/bash
#
# https://docs.docker.com/build/buildkit/
# https://github.com/docker/buildx/releases/
# https://github.com/docker/buildx
mkdir -p $HOME/.docker/cli-plugins
wget https://github.com/docker/buildx/releases/download/v0.11.2/buildx-v0.11.2.linux-amd64
chmod +x buildx-v0.11.2.linux-amd64
mv buildx-v0.11.2.linux-amd64 $HOME/.docker/cli-plugins/docker-buildx
<html>
<head>
<style>
h1 {
text-align: center;
color: blueviolet;
}
h2 {
text-align: center;