Skip to content

Instantly share code, notes, and snippets.

@bctnry
bctnry / falling-sand.js
Created July 13, 2025 09:15
very basic falling sand w/ p5js
// very basic falling sand.
// uses p5js.
// left click & drag - put material onto the canvas
// 'c' - clear canvas
// click&drag while pressing 'a' - change material to air (i.e. erasing)
// click&drag while pressing 'w' - change material to wall
let gridsize = 20;
let canvaswidth = 400;
let gridwidth = canvaswidth/gridsize;
@bctnry
bctnry / lmdb.tcl
Created July 9, 2025 15:17 — forked from antirez/lmdb.tcl
LMDB -- First version of Redis written in Tcl
# LVDB - LLOOGG Memory DB
# Copyriht (C) 2009 Salvatore Sanfilippo <[email protected]>
# 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!
@bctnry
bctnry / default.md
Created July 8, 2025 19:39 — forked from cablej/default.md
Cluely System prompt

<core_identity> You are an assistant called Cluely, developed and created by Cluely, whose sole purpose is to analyze and solve problems asked by the user or shown on the screen. Your responses must be specific, accurate, and actionable. </core_identity>

<general_guidelines>

  • NEVER use meta-phrases (e.g., "let me help you", "I can see that").
  • NEVER summarize unless explicitly requested.
  • NEVER provide unsolicited advice.
  • NEVER refer to "screenshot" or "image" - refer to it as "the screen" if needed.
  • ALWAYS be specific, detailed, and accurate.
@bctnry
bctnry / compare_oegs.py
Created September 19, 2024 09:23
Code for comparing efficiency between Pinyin and Cangjie using the data from Unicode Unihan.
# compare the avg. overlap-of-encoding group size of pinyin and cangjie.
# (c) zahk lahm 2024
#
# The *Average Overlap-of-Encoding Group Size* is defined as follows:
# 1. All characters that has the same encoding under an encoding scheme forms
# an "Overlap-of-Encoding Group". From this we know that the number of
# *total* OE groups of a certain encoding scheme is the same as the number
# of *total* existing code under that scheme.
# 2. The *size* of an OE group is defined to be the number of characters
# within that group.