Skip to content

Instantly share code, notes, and snippets.

View presmihaylov's full-sized avatar

Pres Mihaylov presmihaylov

View GitHub Profile
git clone https://github.com/pmihaylovcom/go-elk-tutorial
version: '2.2'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.6.2
volumes:
- ./config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml:ro
healthcheck:
test: ["CMD", "curl", "-s", "-f", "http://localhost:9200/_cat/health"]
interval: 3s
@presmihaylov
presmihaylov / index.ts
Created March 9, 2025 17:34
Weather MCP Server example
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import { z } from "zod";
const server = new McpServer({
name: "Weather server",
version: "1.0.0",
});
server.tool(
@presmihaylov
presmihaylov / slackAlerts.ts
Created May 10, 2025 07:04
Simple slack alerts
import type { Result } from "true-myth";
export function newSlackAlertInterceptor(args: {
slackWebhookUrl: string;
environment: string;
appName: string;
logsUrl: string;
}) {
const { slackWebhookUrl, environment, appName, logsUrl } = args;
const baseParams = {
@presmihaylov
presmihaylov / ccfin
Created July 8, 2025 07:38
Claude code notification on finish
#!/bin/bash
osascript -e 'tell application "System Events" to if (name of first application process whose frontmost is true) is not "Alacritty" then display notification "I finished my current task" with title "claude code" sound name "Funk"'
#!/bin/bash
# Use the first argument as the message, or default to "I finished my current task"
message="${1:-I finished my current task}"
osascript -e "display notification \"$message\" with title \"claude code\" sound name \"Funk\""
package txmanager
import (
"context"
"fmt"
"log"
"github.com/jmoiron/sqlx"
dbtx "ccbackend/db/tx"