Skip to content

Instantly share code, notes, and snippets.

View arnelirobles's full-sized avatar
☕
brewing

Arnel Robles arnelirobles

☕
brewing
View GitHub Profile
@arnelirobles
arnelirobles / 03-nullish-probe.ts
Created August 26, 2026 07:28
rnxORM: 03-nullish-probe
// The case a naive recorder gets wrong, and the fix.
//
// u => u.nickname || u.name
//
// The proxy returns a marker for `nickname`. A marker is an object, so it is
// truthy, so `||` short-circuits and the right operand NEVER RUNS. The recorder
// observes exactly one property access and returns cleanly, which is identical
// to what a faithful single-column selector looks like.
//
// No proxy trap can fix this. `u.name` did not execute, so there is nothing to
@arnelirobles
arnelirobles / 02-recorder.ts
Created August 26, 2026 07:28
rnxORM: 02-recorder
// Instead of reading the lambda's source, run it against a root that records
// what gets touched. The regex sees what a developer typed. This sees what the
// code did, which is the question actually being asked.
const PATH = Symbol('path');
function createRecorder() {
let coerced = false;
let accesses = 0;
@arnelirobles
arnelirobles / 01-regex-selector.js
Created August 26, 2026 07:28
rnxORM: 01-regex-selector
// What rnxORM used to do to turn `u => u.email` into the column name "email".
// Four lines, works immediately, and wrong in a way that never announces itself.
function extractPropertyName(fn) {
const fnStr = fn.toString();
const match = fnStr.match(/(?:=>|return)\s*\w+\.(\w+)/);
if (match && match[1]) return match[1];
throw new Error('Unable to extract property name from function: ' + fnStr);
}

BarakoCMS Contributor License Agreement

By submitting a contribution to BarakoCMS, you agree:

  1. Grant of Rights: You grant Arnel Robles and BarakoCMS perpetual, worldwide, royalty-free license to use, modify, distribute, and sublicense your contribution
  2. Patent Grant: You grant patent rights for any patents necessarily infringed by your contribution
  3. No Payment Claims: You waive any right to payment or compensation for your contribution
  4. Ownership: You retain copyright but cannot demand payment in the future

This protects both contributors and the project, allowing BarakoCMS to evolve (including potential commercial offerings) while protecting you from liability.

# BarakoCMS Contributor License Agreement
By submitting a contribution to BarakoCMS, you agree:
1. **Grant of Rights**: You grant Arnel Robles and BarakoCMS perpetual, worldwide, royalty-free license to use, modify, distribute, and sublicense your contribution
2. **Patent Grant**: You grant patent rights for any patents necessarily infringed by your contribution
3. **No Payment Claims**: You waive any right to payment or compensation for your contribution
4. **Ownership**: You retain copyright but cannot demand payment in the future
This protects both contributors and the project, allowing BarakoCMS to evolve (including potential commercial offerings) while protecting you from liability.
@arnelirobles
arnelirobles / MinimalAPIs.md
Created December 6, 2021 14:06 — forked from davidfowl/MinimalAPIs.md
Minimal APIs at a glance