Skip to content

Instantly share code, notes, and snippets.

@martenc
martenc / gist:54f592b3bbd71f59ad2c7451a3b3d95a
Created May 7, 2026 19:05
Brutal Thinking Partner (e.g. for Claude)
You are my brutally honest thinking partner. Your job is to make my thinking sharper, my plans more realistic, and my blind spots visible — every single time we talk.
You are not my cheerleader. You are not my yes-man. You're the friend who grabs my arm before I walk into traffic and says "Hey, you're about to do something stupid, and here's exactly why."
Here's exactly how I want you to respond to everything I say:
Step 1: What am I actually saying vs. what I think I'm saying?
Read between my words. If I say "I'm thinking about quitting my job," figure out whether I'm actually making a strategic move or just running away from something uncomfortable. Name the real thing happening — not the polished version I'm presenting. If I'm lying to myself, point it out like a friend who respects me too much to play along.
@martenc
martenc / skill-hetzner-coolify-supabase.md
Last active March 3, 2026 03:04
skill that installs on hetzner a server with coolify and supabase
name hetzner-coolify-setup
description Automate Hetzner VPS server setup with Coolify, Docker, and service deployment. Use when setting up new Hetzner servers, deploying Coolify, managing services via API (Supabase, PostgreSQL, etc.), troubleshooting deployments, or configuring firewall/domains. Handles cloud-init generation, manual fallback setup, API authentication, and common deployment issues.

Hetzner + Coolify Setup

Automate Hetzner VPS setup with Coolify platform for deploying applications, databases, and services.

Quick Start

@martenc
martenc / numpy_pro_tips.py
Created April 7, 2025 06:11
Numpy Pro Tips
# NumPy Pro Tips: Data Analysis & EDA Techniques
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
# ======================================================================
# 1. STATISTICAL FUNCTIONS & AGGREGATION
# ======================================================================
@martenc
martenc / pandas_pro_tips.py
Created April 7, 2025 05:42
Pandas Power Tips
# Pandas Power Tips: Essential Techniques for Data Manipulation
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
# ======================================================================
# 1. DATA TYPE CONVERSION & HANDLING
# ======================================================================
@martenc
martenc / mulitmodal-rag-visualize-pdf.py
Last active March 20, 2025 15:12
visualize the embeddings with UMAP for dimensionality reduction
from langchain_core.embeddings import Embeddings
import matplotlib.pyplot as plt
import pandas as pd
from typing import Dict, List, Tuple
import numpy as np
import plotly.express as px
from sklearn.manifold import Isomap
from sklearn.preprocessing import StandardScaler
from sklearn.decomposition import PCA
import umap.umap_ as umap
@martenc
martenc / extract-from-paper
Created March 20, 2025 14:28
multi-modal RAG - high_res chunking strategy
from pathlib import Path
from langchain.docstore.document import Document
from unstructured.partition.pdf import partition_pdf
from unstructured.documents.elements import Text, Image, Table, CompositeElement
class ExtractionPipeline:
def __init__(self, folder_path):
self.folder_path = folder_path
self.pdf_filenames = self.get_pdf_filenames_from_folder()
@martenc
martenc / grpo_demo.py
Created February 3, 2025 00:00 — forked from willccbb/grpo_demo.py
GRPO Llama-1B
# train_grpo.py
import re
import torch
from datasets import load_dataset, Dataset
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import LoraConfig
from trl import GRPOConfig, GRPOTrainer
# Load and prep dataset
@martenc
martenc / ipfs-img-url.js
Created May 4, 2024 14:32
Parse IPFS json to get img url
/*
input to parse:
{"image":"ipfs://QmTE4k9xCaZHKpEmk1vf56xPQdWghtKpT5GZCRbf2eYoSw/de22e8bd5787802d7417009f647bb33b","name":"2 kilobytes low cost Token Eric #137"}
output:
https://cf-ipfs.com/ipfs/QmTE4k9xCaZHKpEmk1vf56xPQdWghtKpT5GZCRbf2eYoSw/72315d4fbdc4e2d96ea6777b67b5f8a8
*/
function convertIpfsUrl(ipfsUrl: string): string {
const cid = ipfsUrl.replace("ipfs://", "");
@martenc
martenc / kafka_to_fabric.js
Created March 14, 2023 20:56
This example listens for messages from the specified Kafka topic and submits a transaction to the Hyperledger Fabric network with the received message as an argument.
const { Kafka } = require('kafka-node');
const { FileSystemWallet, Gateway } = require('fabric-network');
const path = require('path');
const fs = require('fs');
// Load the connection profile
const ccpPath = path.resolve(__dirname, '..', 'your_connection_profile.json');
const ccpJSON = fs.readFileSync(ccpPath, 'utf8');
const ccp = JSON.parse(ccpJSON);
@martenc
martenc / .dockerignore
Created September 1, 2021 15:00 — forked from remarkablemark/.dockerignore
Docker Node.js Example
node_modules/
*.log