Skip to content

Instantly share code, notes, and snippets.

View Loschcode's full-sized avatar
🌀
Probably coding

Laurent Schaffner Loschcode

🌀
Probably coding
View GitHub Profile
@Loschcode
Loschcode / security-audit-dashboard-clinicas-2026-07-23.md
Last active July 23, 2026 17:23
Security Audit Report — Dashboard Clínicas (+Pacientes) — 2026-07-23

Security Audit Report — Dashboard Clínicas (+Pacientes)

Date: 2026-07-23 Scope: Full codebase at /Users/loschcode/Desktop/work/dashboard-clinicas Methodology: OWASP Top 10:2025, OWASP API Security Top 10:2023, OWASP Top 10 for LLM Applications:2025 Stack: React 19 + Vite 8 + Supabase (Postgres + Auth + Storage) + Vercel serverless + Stripe + Anthropic/OpenAI APIs


Executive Summary

#!/usr/bin/env bash
# Linkbreakers MCP setup helper. Feel free to copy/share (e.g., as a GitHub Gist).
set -euo pipefail
if ! command -v python3 >/dev/null 2>&1; then
echo "Error: python3 is required to update the JSON config."
exit 1
fi
if [ -t 1 ]; then
@Loschcode
Loschcode / custom-domain-api-digitalocean-app-platform.go
Created March 31, 2025 16:48
Manipulate DigitalOcean App Platform API to add custom domains on the fly when Linkbreakers is being manipulated. This is a hack and not meant to stay in the system. We should go for Custom Hostname from Cloudflare on a next iteration.
// Manipulate DigitalOcean App Platform API
// To add custom domains on the fly when Linkbreakers is being manipulated
// This is a hack and not meant to stay in the system.
// We should go for Custom Hostname from Cloudflare on a next iteration.
package cluster
import (
"context"
"fmt"
"regexp"
@Loschcode
Loschcode / job_scheduler.go
Created April 20, 2024 01:12
Job scheduler in Golang
package job_scheduler
import (
"context"
"database/sql/driver"
"encoding/json"
"fmt"
"log"
"time"
Engines::Core::Rpc::Client.new(
service: ::Rpc::Services::LiveCommunications::Messages
).get_message(
::Rpc::Backend::GetMessageRequest.new(
message_id: "21ef149a-09ac-11ed-861d-0242ac120002"
)
)
syntax = "proto3";
package rpc.my_package;
service MyService {
rpc GetSomething(GetSomethingRequest) returns (GetSomethingResponse) {}
}
# concurrent migration strategy
# when migrating through this script
# you can launch it on multiple processes
# and they will deal with the concurrency by
# themselves without interrupting or crashing
class MigrateConcurrently
class Error < StandardError; end
DELAY_BETWEEN_CYCLES_IN_SECONDS = 3
MAX_CYCLES = 100
class MigrateConcurrently
class Error < StandardError; end
...
def raise_if_max_cycles_reached
...
raise Error, ...
end
end
class MigrateConcurrently
DELAY_BETWEEN_CYCLES_IN_SECONDS = 3
MAX_CYCLES = 100
def initialize; end
def perform
Logger.info(
...
delay_between_cycles_in_seconds: DELAY_BETWEEN_CYCLES_IN_SECONDS,
# concurrent migration strategy
# when migrating through this script
# you can launch it on multiple processes
# and they will deal with the concurrency by
# themselves without interrupting or crashing
class MigrateConcurrently
...
end