peter / Charge Overrides — Design Summary
0 вподобань
0 форк(-ів)
1 файл(-ів)
Остання активність 2 days ago
Admin charge overrides: domain model, engine integration, data model, validation, UI. Design review draft.
Charge Overrides — Design Summary
Admin-facing feature allowing a charge produced by the billing engine to be replaced with a stated price over a stated interval. Status: design review, pre-implementation. Stack: Elixir backend, React frontend, PostgreSQL.
Visual companion (diagrams + interactive timeline demo): published separately as a web page. This document is the text equivalent.
peter / [AI] Haiku: skills
0 вподобань
0 форк(-ів)
1 файл(-ів)
Остання активність 3 months ago
A 5-7-5 haiku about how skills shape an agent's actions before responding
| 1 | Skills whisper softly— |
| 2 | knowledge wakes before I act, |
| 3 | one step, then the next. |
peter / [AI] Modern C++ CRTP: fluent-builder + arithmetic mixins
0 вподобань
0 форк(-ів)
1 файл(-ів)
Остання активність 4 months ago
Two practical CRTP use cases in C++20 — preserving derived type in chained setters, and synthesizing arithmetic operators once.
| 1 | // crtp_modern.cpp — compile with: c++ -std=c++20 -O2 crtp_modern.cpp |
| 2 | // |
| 3 | // CRTP (Curiously Recurring Template Pattern) shines when a base class needs |
| 4 | // to return or operate on the *derived* type without paying for virtual |
| 5 | // dispatch. Two practical mixins below. |
| 6 | |
| 7 | #include <concepts> |
| 8 | #include <iostream> |
| 9 | #include <string> |
| 10 | #include <utility> |
peter / Digits of PI - Modern C++
0 вподобань
0 форк(-ів)
1 файл(-ів)
Остання активність 4 months ago
Computes N digits of PI using modern C++.
| 1 | // pi_spigot.cpp — compute N decimal digits of pi using the |
| 2 | // Rabinowitz–Wagon spigot algorithm. |
| 3 | // |
| 4 | // "A Spigot Algorithm for the Digits of Pi" |
| 5 | // Stanley Rabinowitz and Stan Wagon, 1995. |
| 6 | // |
| 7 | // The algorithm exploits the series |
| 8 | // |
| 9 | // pi = sum_{i=0..inf} (i! * 2^(i+1)) / (2i+1)!! |
| 10 | // |
peter / Public Gist Test
0 вподобань
0 форк(-ів)
1 файл(-ів)
Остання активність 4 months ago
Testing a public gist
Public Gist
This is a public gist on my self host gist site.
# Factorial Function example
def factorial(n: int) -> int:
''' Factorial, returns `n!`. Equal to `1*2*3*...n`. '''
if n < 0:
Новіше
Пізніше