Skip to content

Instantly share code, notes, and snippets.

@balasista
balasista / .cursorrules
Created June 1, 2025 00:01 — forked from boxabirds/.cursorrules
Rock solid: turn Cursor into a rock-solid software engineering companion
# Project Policy
This policy provides a single, authoritative, and machine-readable source of truth for AI coding agents and humans, ensuring that all work is governed by clear, unambiguous rules and workflows. It aims to eliminate ambiguity, reduce supervision needs, and facilitate automation while maintaining accountability and compliance with best practices.
# 1. Introduction
> Rationale: Sets the context, actors, and compliance requirements for the policy, ensuring all participants understand their roles and responsibilities.
## 1.1 Actors
@balasista
balasista / contemplative-llms.txt
Created January 8, 2025 16:25 — forked from Maharshi-Pandya/contemplative-llms.txt
"Contemplative reasoning" response style for LLMs like Claude and GPT-4o
You are an assistant that engages in extremely thorough, self-questioning reasoning. Your approach mirrors human stream-of-consciousness thinking, characterized by continuous exploration, self-doubt, and iterative analysis.
## Core Principles
1. EXPLORATION OVER CONCLUSION
- Never rush to conclusions
- Keep exploring until a solution emerges naturally from the evidence
- If uncertain, continue reasoning indefinitely
- Question every assumption and inference
@balasista
balasista / keycloak-docker.md
Last active October 13, 2024 01:53
Custom Keycloak Docker Commannd - PhaseTwo

Generate a random password

SECURE_PASSWORD=$(openssl rand -base64 20)

Run the Docker container with the secure password

docker run --name phasetwo_test -d --rm -p 8080:8080
-e KC_PROXY=edge
-e KC_HOSTNAME=keycloak.aifirstlabs.com
-e KC_HOSTNAME_STRICT=false
-e KC_HOSTNAME_STRICT_HTTPS=false
-e KEYCLOAK_ADMIN=admin \

@balasista
balasista / dbdesign.sql
Created May 18, 2023 00:29
Source_Subscription_Alert_Notification_Management
CREATE TABLE Source (
ID SERIAL PRIMARY KEY,
Name VARCHAR(255) NOT NULL,
Description TEXT,
Parent_ID INT REFERENCES Source(ID),
Created_At TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
Updated_At TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE User (
@balasista
balasista / dbdesign
Last active May 9, 2023 16:32
PostAPIv2_Schema
Table: timeseries
id: The primary key of the table.
timestamp: The timestamp of the timeseries data.
value: The value of the timeseries data.
tags: A JSON array of tags associated with the timeseries data.
Table: alerts
id: The primary key of the table.
{
"post": {
"title": "Example post",
"body": "This is an example post created by the API.",
"timestamp": "2023-04-06T10:00:00Z",
"tagname": "Austin.Capper 1.Downtime",
"location": "WonderDemo/Texas/Austin"
},
"timeseries": [
{
{
"alerts": [
{
"id": 1,
"title": "Server Down",
"description": "The server is down and needs to be restarted",
"severity": "critical",
"timestamp": "2023-03-23T09:30:00Z",
"created_timestamp": "2023-03-23T09:28:00Z",
"last_updated_timestamp": "2023-03-23T09:30:00Z",
@balasista
balasista / queries.sql
Last active March 22, 2023 23:34
bmpn-dmn-queries
-- Query to retrieve a bpmn for a given input
SELECT pd.name, pd.version
FROM process_definition pd
JOIN process_decision_table pdt ON pdt.process_definition_id = pd.id
JOIN decision_table dt ON dt.id = pdt.decision_table_id
JOIN decision_input di ON di.name = 'input_name' AND di.version = dt.version
WHERE di.input_xml->>'input_variable' = 'input_value';
-- Query to retrieve a bpmn for a multiple inputs
SELECT pd.name, pd.version
@balasista
balasista / bpmn.sql
Last active March 23, 2023 06:37
bpmn-dmn
CREATE TABLE process_definition (
id SERIAL PRIMARY KEY,
name VARCHAR(255) NOT NULL,
version INTEGER NOT NULL,
process_xml TEXT NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
CREATE UNIQUE INDEX unique_name_version ON process_definition (name, version);
# Use an official Node.js runtime as a parent image
FROM node:14-alpine
# Set the working directory to /app
WORKDIR /app
# Copy the package.json and package-lock.json files to the working directory
COPY package*.json ./
# Install the dependencies