Skip to content

Instantly share code, notes, and snippets.

@scottcagno
scottcagno / simple-wal.go
Last active September 11, 2021 04:30
a simple segmented write-ahead logger
package wal
import (
"encoding/binary"
"errors"
"fmt"
"io"
"os"
"path/filepath"
"runtime"
@scottcagno
scottcagno / datafile.go
Created May 5, 2021 04:59
DataFile buffered io file wrapper for handling, reading, and writing binary data
package db
import (
"bufio"
"encoding/binary"
"io"
"os"
"path/filepath"
"unsafe"
)
@scottcagno
scottcagno / bplus.go
Last active March 26, 2021 17:02
b+ tree, hand transposed from c
/*
* // Copyright (c) 2021. Scott Cagno. All rights reserved.
* // Use of this source code is governed by a BSD-style (clause 3)
* // license that can be found in the root of this project in the LICENSE file.
*/
package bptree
import (
"bytes"
@mcastilho
mcastilho / gist:e051898d129b44e2f502
Last active June 23, 2023 18:33
Cheap MapReduce in Go
package main
import (
"bufio"
"encoding/csv"
"encoding/json"
"fmt"
"io"
"os"
"path/filepath"