Skip to content

Instantly share code, notes, and snippets.

@ml-eds
ml-eds / LLM-mental-therapy-prompts-guide.md
Created August 26, 2026 10:54 — forked from kidclone3/LLM-mental-therapy-prompts-guide.md
Research-backed prompts and architecture for building a mental health therapy AI agent (LLM prompt engineering guide)

Designing a Personal-Guidance LLM Agent: A Meta-Guide

Purpose: A reusable design framework for building LLM agents that give personal guidance in any high-stakes domain — mental health, career, financial, parenting, relationships, learning. Sections 1–6 are domain-agnostic instructions. Section 7 is a worked case study (mental health therapy) showing every rule instantiated. Last updated: 2026-05-04 ⚠️ Disclaimer: AI is not a substitute for licensed professionals. Any agent built from this guide must include crisis escalation and professional referral paths.


1. When to use this guide

@ml-eds
ml-eds / mental-model.md
Created August 26, 2026 10:49 — forked from kidclone3/mental-model.md
The Mental Model for Success: From Software Engineer to Life

The Mental Model for Success: From Software Engineer to Life

A Lattice, Not a Single Idea

Charlie Munger's key insight was that no single mental model is enough. You need a latticework — a connected web of thinking tools from many disciplines. The models hang together and reinforce each other. The person with 80–90 well-understood models across psychology, engineering, economics, and biology will consistently outperform the person who only thinks in code.

Here's a structured lattice, from craft to life:


@ml-eds
ml-eds / postgres_ssl_configuration.md
Created November 14, 2022 13:14
How to activate SSL (self-signed certs) for PostgreSQL

SSL for Postgres connections

In the following we will create a self-signed certificate (without self-signed Root CA certificate, to keep things simple)

postgresql.conf

In /var/lib/postgresql/data:

nano postgresql.conf
@ml-eds
ml-eds / git_diff.sh
Created April 26, 2022 12:07
git diff - export all changed files between two commits into tar archive
# export all changed files from commit b58b5f9 to commit HEAD into tar archive
git diff-tree -r --no-commit-id --name-only --diff-filter=ACMRT b58b5f9^..HEAD | tar -czf file.tgz -T -
@ml-eds
ml-eds / .zshrc
Created April 22, 2022 09:55
Unix timestamp to date bash / zsh
# Convert Unix timestamp to date in zsh/bash
#
# Add to .zshrc or .bash_profile
#
# Example usage: ts2date 1650621128
# Example output: 2022-04-22 11:52:08
timestamp2date() {
date -r "$1" '+%Y-%m-%d %H:%M:%S'
}
@ml-eds
ml-eds / replace.sh
Last active August 26, 2020 06:48
Shell script to replace strings in files based on two file-based lists
#!/bin/bash
# given list_search.txt with content, e.g.
# <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="3.1.0" />
# <PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="3.1.0" />
# given list_replace.txt with content, e.g.
# <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="3.1.5" />
# <PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="3.1.5" />
@ml-eds
ml-eds / addcert.sh
Last active November 7, 2019 11:06
Ubuntu: Add missing CA certificate
# good reference: https://wiki.ubuntuusers.de/CA/
# download missing cert DigiCertHighAssuranceEVRootCA.crt
wget --no-check-certificate https://dl.cacerts.digicert.com/DigiCertHighAssuranceEVRootCA.crt
# convert to pem format
openssl x509 -inform DER -outform PEM -in DigiCertHighAssuranceEVRootCA.crt -out DigiCertHighAssuranceEVRootCA.pem.crt
# copy to /usr/local/share/ca-certificates
cp DigiCertHighAssuranceEVRootCA.pem.crt /usr/local/share/ca-certificates/
@ml-eds
ml-eds / postman_set_env.js
Last active October 24, 2019 06:58
Postman: Write response values back to environment vars
// Place the following in the "Tests" tab of a request
// Check HTTP status code
tests['Status 200'] = responseCode.code === 200;
// We need valid JSON
var validJSON = false;
var resData = {};
try {
resData = JSON.parse(responseBody);
@ml-eds
ml-eds / git_precommit_hook_tslint.md
Last active August 28, 2019 09:28
Node + Typescript: How to configure git pre-commit hook with TSLint

TSLint pre-commit hook

Important!

Must be configured on top level directory of a project when having a multi-package project (e.g. frontend + backend).

Install

npm install --save-dev husky lint-staged
@ml-eds
ml-eds / shell_command.sh
Last active July 16, 2019 09:58
Shell: Find files modified after a certain time
find . -type f -newermt '7/14/2019 16:00:00'