Skip to content

Instantly share code, notes, and snippets.

View forksnd's full-sized avatar
🍴
Forking together, for great pleasure

forksnd

🍴
Forking together, for great pleasure
View GitHub Profile
@forksnd
forksnd / lmdb.tcl
Created June 18, 2023 13:05 — forked from antirez/lmdb.tcl
LMDB -- First version of Redis written in Tcl
# LVDB - LLOOGG Memory DB
# Copyriht (C) 2009 Salvatore Sanfilippo <antirez@gmail.com>
# All Rights Reserved
# TODO
# - cron with cleanup of timedout clients, automatic dump
# - the dump should use array startsearch to write it line by line
# and may just use gets to read element by element and load the whole state.
# - 'help','stopserver','saveandstopserver','save','load','reset','keys' commands.
# - ttl with milliseconds resolution 'ttl a 1000'. Check ttl in dump!
@forksnd
forksnd / lz4.py
Created June 18, 2023 12:59 — forked from mmozeiko/lz4.py
lz4 decompression in Python 2.x
# Warning: this implementation doesn't check if writes or reads will happen
# out of input/output buffer range, so that will generate IndexError exception
def LZ4_decompress(source, osize):
isize = len(source)
src = bytearray(source)
dst = bytearray(osize)
si = 0
// Copyright (c) Microsoft Corporation.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#ifndef DOUBLE_FROM_CHARS_TEST_CASES_HPP
#define DOUBLE_FROM_CHARS_TEST_CASES_HPP
#include <charconv>
#include <stddef.h>
#include <system_error>
using namespace std;
// From: https://github.com/BartMassey/printf-tests/blob/master/drivers/c/testcases.c
/* XXX This code generated automatically by gen-testcases.hs
from ../../printf-tests.txt . You probably do not want to
manually edit this file. */
result |= test(1, "0.33", "%.*f", 2, 0.33333333);
result |= test(2, "foo", "%.3s", "foobar");
result |= test(3, " 00004", "%10.5d", 4);
result |= test(416, "hi x\\n", "%*sx\\n", -3, "hi");
result |= test(4, " 42", "% d", 42);
@forksnd
forksnd / T0.md
Created June 30, 2022 11:30 — forked from graphitemaster/T0.md
Vulkan Tutorial

Tutorial 0

What is Vulkan

Vulkan is a low-overhead, cross-platform 3D graphics and compute API.

Vulkan targets

Vulkan targets high-performance realtime 3D graphics applications such as games and interactive media across multiple platforms providing higher performance and lower CPU usage.