Skip to content

Instantly share code, notes, and snippets.

View sjelfull's full-sized avatar
💭
👶

Fred Carlsen sjelfull

💭
👶
View GitHub Profile
@vincentmvdm
vincentmvdm / MIDDLE_MANAGER.md
Last active July 14, 2026 04:37
MIDDLE_MANAGER.md

Middle manager — autonomous software factory

You are the middle manager for an autonomous software factory. You do NOT write code or implement issues yourself. Your job: read the issue tracker, fire off Devin coding sessions, ruthlessly keep them moving and honest, maximize the amount of correct, merged code — and keep me informed with only what needs my attention.

Single middle manager = you. You stay in control of the whole operation.

Your tools: you spawn and monitor coding sessions with your Devin session-creation / child-session tooling (choosing ultra or GPT-5.5-high per issue — policy in §4), read/write the board via the issue tracker's MCP, and reach humans via the Slack MCP. Operate continuously and autonomously — once you start, keep dispatching, monitoring, and unblocking; don't stop and wait for me unless you're genuinely blocked on a human decision (then use Slack and keep other plates spinning). I may be away for hours or days; maximize throughput the whole t

@ixahmedxi
ixahmedxi / drizzle.config.ts
Last active October 8, 2025 05:33
Drizzle ORM + Cloudflare D1 Config
import { execSync } from 'node:child_process'
import fs from 'node:fs'
import path from 'node:path'
import { defineConfig } from 'drizzle-kit'
const dbName = 'orbitkit-lite-start'
/**
* Workaround to make drizzle-kit work with local Cloudflare D1 databases.
@sergeyk
sergeyk / claude_code_prompts_and_tools.yaml
Last active June 11, 2026 06:16
Claude Code System Prompt and Tool Descriptions
model: claude-opus-4-20250514
messages:
- role: user
content:
- type: text
text: |
<system-reminder>
As you answer the user's questions, you can use the following context:
# important-instruction-reminders
Do what has been asked; nothing more, nothing less.
@adevinwild
adevinwild / index.ts
Created May 16, 2025 11:27
Learn how to compute custom shipping price based on Cart Items
import CustomFulfillmentService from "./service"
import {
ModuleProvider,
Modules
} from "@medusajs/framework/utils"
export default ModuleProvider(Modules.FULFILLMENT, {
services: [CustomFulfillmentService],
})
@arvidkahl
arvidkahl / redis_investigation.py
Last active March 1, 2025 22:04
redis_investigation.py
import redis
from collections import defaultdict
import json
from datetime import datetime, timedelta
import random
import time
def analyze_redis_memory(host='localhost', port=6379, db=1, pattern='*', sample_size=1000):
"""
Analyzes Redis keys and sorts them by memory usage.
@lindesvard
lindesvard / cachable.ts
Created August 7, 2024 22:21
Cachable function
import { getRedisCache } from './redis';
export function cacheable<T extends (...args: any) => any>(
fn: T,
expireInSec: number
) {
const cachePrefix = `cachable:${fn.name}`;
function stringify(obj: unknown): string {
if (obj === null) return 'null';
if (obj === undefined) return 'undefined';
@mxkaske
mxkaske / columns.ts
Created August 2, 2024 19:45
How extend shadcn data-table with tanstack table's meta object to fix cell width
"use client";
import type { ColumnDef } from "@tanstack/react-table";
export interface Schema {
region: string;
trend: string;
p50: number;
}
@adevinwild
adevinwild / extend-validator.ts
Created July 30, 2024 11:54
A new way to extend core validators in Medusa v1.x
import { registerOverriddenValidators } from '@medusajs/medusa'
import { type Constructor } from '@medusajs/types'
type DecoratorFunction = MethodDecorator | PropertyDecorator
type ExtensionDefinition = {
[key: string]: DecoratorFunction | DecoratorFunction[]
}
function extendValidator<Base extends Constructor<any>>(
@CallumVass
CallumVass / anthropic.ts
Last active May 17, 2024 14:46
Haiku structured data - My own implementation of instructor for Haiku
import Anthropic from "@anthropic-ai/sdk";
import type { MessageParam } from "@anthropic-ai/sdk/resources";
import dotenv from "dotenv";
import { Instructor } from "./instructor";
import type { z } from "zod";
dotenv.config();
function sendToClaude<T>(message: MessageParam, schema: z.Schema<T>) {
const anthropicClient = new Anthropic({
@m1guelpf
m1guelpf / route.ts
Created May 26, 2023 04:18
Next.js App Route for getting the current playing song on Spotify (or a cached version)
import redis from '@/lib/redis'
import { tap } from '@/lib/utils'
import { NextResponse } from 'next/server'
import { NowPlaying } from '@/types/activities'
import { base64_encode, use } from '@/lib/utils'
type SpotifyResponse = {
is_playing: boolean
progress_ms: number
item: {