Skip to content

Instantly share code, notes, and snippets.

View ewaldbenes's full-sized avatar

Ewald Benes ewaldbenes

View GitHub Profile

Architecture: Modular Monolith Status: Production_Ready License: MIT

The Ultimate Project Layout Reference

This reference outlines a robust file system layout for enterprise-grade software projects. It provides a blueprint for structuring source code to achieve a modular, maintainable architecture.

The layout accounts for complex requirements such as multiple transport types (HTTP, WebSockets, CLI), varied data encodings, and multi-tenancy configurations where specific clients require custom database extensions. While few projects require every directory presented here simultaneously, this guide serves as a comprehensive map for placing code and resources correctly. It also guides you on how to scale down the layout for smaller projects below the full layout.

SQLite Cache Schema

This schema provides a ready-to-use structure for caching different data types.

Types

Immutable

It efficiently stores and retrieves immutable binary and textual data, accessed by a textual key. Use the cache_blob and cache_text tables for this purpose.

@ewaldbenes
ewaldbenes / trim-icalendar-ics
Last active January 19, 2026 02:28
Removes all events preceeding a given year and month from an .ics calendar file.
#!/bin/bash
# Usage: ./trim-icalendar-ics foo-bar.ics 2024 06
# Removes all events before 2024 and month May (or keeps everything from May 2024 onwards)
# and saves the remaining events into the file foo-bar.ics.out
# Note: current working directory must be the one where the ics file resides!
# Note for Mac and BSD users: this script requires the GNU version of csplit and sed!
@ewaldbenes
ewaldbenes / file_entropy.py
Created December 8, 2018 13:07
Calculate Shannon entropy of a file to show randomness of contained data. Can give hints if a file is compressed or encrypted. Entropy of 0 means all data is equal hence no randomness at all. 8 means perfect randomness which is the mathematical limit.
# file_entropy.py
#
# Shannon Entropy of a file
# = minimum average number of bits per character
# required for encoding (compressing) the file
#
# So the theoretical limit (in bytes) for data compression:
# Shannon Entropy of the file * file size (in bytes) / 8
# (Assuming the file is a string of byte-size (UTF-8?) characters
# because if not then the Shannon Entropy value would be different.)
@ewaldbenes
ewaldbenes / firebase-csv-user-import.ts
Created December 4, 2018 10:15
Firebase user import from CSV using admin tools and RxJs
/**
* Written in Typescript (v3+).
*
* Dependencies:
* - rxjs >= 6
* - firebase-tools >= 6
*
* Have fun!
*
*/