Skip to content

Instantly share code, notes, and snippets.

View LucasRoesler's full-sized avatar

Lucas Roesler LucasRoesler

View GitHub Profile
@LucasRoesler
LucasRoesler / README.md
Created March 3, 2025 09:58
GenAI Coding Agent helper memory bank instructions

Memory Bank

The memory bank concept tells the GenAI Agent to track the context of it's current task. Generally this helps it to stay more focused and produce better results while also encapsulating important contextual and technical infomration that is required for larger tasks. It also make it easier for the agent to identify new or future tasks without becoming sidetraked.

The iniital text init_memory_bank.md is a simple prompt to tell the agent to create the required memory bacnk content. THis can of course be adjusted so that it tracks additional information or is stored in a different location.

I generally include the memory bank folder in the .gitignore because I view it as hyper specific to my work on a project. But for personal projects, you might also commit it.

The how_to_use.md is also included into .memory folder. I actually asked it ot generate this as a "minimal prompt that tells you how to use the memory bank"

@LucasRoesler
LucasRoesler / log_fdw_helpers.sql
Last active February 23, 2025 11:31
Helper functions and views to use the log_fdw in AWS RDS
-- Create the extension if it doesn't exist
CREATE EXTENSION IF NOT EXISTS log_fdw;
-- Create the server if it doesn't exist
DO $$
BEGIN
IF NOT EXISTS (
SELECT 1 FROM pg_foreign_server WHERE srvname = 'log_fdw_server'
) THEN
@LucasRoesler
LucasRoesler / Dockerfile
Last active June 28, 2024 20:16
My default pyright and ruff configuration for new projects
FROM python:3.12.0-slim-bullseye AS build
RUN apt-get update && apt-get install -y gcc
ENV POETRY_VIRTUALENVS_IN_PROJECT=true \
POETRY_NO_INTERACTION=1 \
POETRY_VIRTUALENVS_OPTIONS_NO_SETUPTOOLS=1
RUN pip install "poetry>=1.8"
WORKDIR /app
@LucasRoesler
LucasRoesler / README.md
Last active November 17, 2023 13:07
Find squash-commited branches that can be deleted

Git Branch Audit

  1. It retrieves the name of the default branch from the remote repository using the git ls-remote command.
  2. It checks out the default branch locally.
  3. It lists all local branches using the git for-each-ref command.
  4. For each local branch, it finds the merge base between the default branch and the current branch using the git merge-base command.
  5. It creates a temporary commit tree for the current branch using the git commit-tree command.
  6. It checks if the temporary commit is a descendant of the default branch using the git cherry command.
  7. If the temporary commit is not a descendant (i.e., the branch has been merged into the default branch), it prints a message indicating that the branch can be deleted.
@LucasRoesler
LucasRoesler / create-repo.sh
Last active June 28, 2024 20:17
create-python-repo.sh
#!/bin/bash
# source: https://gist.github.com/LucasRoesler/c7b245bcd9f33bc989e279ba9cdb9828
# usage:
# create-repo name [owner]
# create-repo name # owner defaults to contiamo
# name is the first arg, fallback to the the current directory name
NAME="$1"
OWNER=${2:-contiamo}
@LucasRoesler
LucasRoesler / writer.test.ts
Last active September 20, 2022 09:08
streaming chunked file upload to s3 in typescript
import { S3Client } from "@aws-sdk/client-s3";
import { streamingWrite, Upload } from "./writer";
const sleep = (ms: number) => {
return new Promise(resolve => setTimeout(resolve, ms));
};
// skip because it requires a real s3 bucket, this is still useful for testing locally.
describe.skip("streamingWriter", () => {
@LucasRoesler
LucasRoesler / README.md
Last active March 23, 2025 07:09
Example cloudformation that sets up an s3 bucket and notifications sent to an sqs queue.

Usage

Create a new user in the console, assign it no permissions, but make sure to download the credentials.

Go to the user and copy the user ARN:

arn:aws:iam::<account-id>:user/of-connector-test
@LucasRoesler
LucasRoesler / openfaas-fsgroup.sh
Created March 12, 2020 19:06
Installing openfaas with fsGroup security policy poc
kubectl create namespace openfaas-fn
kubectl create namespace openfaas
kubectl -n openfaas create secret generic basic-auth \
--from-literal=basic-auth-user=admin \
--from-literal=basic-auth-password=localdev
helm upgrade lucas-of openfaas/openfaas \
--install \
--namespace openfaas \
--set basic_auth=true \
--set functionNamespace=openfaas-fn \
@LucasRoesler
LucasRoesler / chrome_HSTS_clear.md
Created December 18, 2019 12:20 — forked from stollcri/chrome_HSTS_clear.md
Clear 307 HSTS redirects in Google Chrome

To clear 307 HSTS redirects in Google Chrome (if you experimenting with SSL -- you probably wouldn't want to do this for a site that you do not opperate, since it is there to protect you), go to the following URL and delete the site.

chrome://net-internals/#hsts

@LucasRoesler
LucasRoesler / kind-faas-netes-certification.md
Created July 28, 2019 09:27
Running OpenFaaS Certifier for faas-netes in KinD
  1. Start the KinD env and disable auth. In the faas-netes project
make start-kind
export KUBECONFIG="$(kind get kubeconfig-path --name="kind")"

helm upgrade openfaas --install ./chart/openfaas \
    --namespace openfaas  \
    --set basic_auth=false \
--set openfaasImagePullPolicy=IfNotPresent \