Skip to content

Instantly share code, notes, and snippets.

@vaso991
vaso991 / refactor-prompt.txt
Created April 15, 2026 08:45
Refactor Prompt
I want to clean up my codebase and improve code quality. This is a complex task, so we'll need 8 subagents. Make a sub agent for each of the following:
1. Deduplicate and consolidate all code, and implement DRY where it reduces complexity
2. Find all type definitions and consolidate any that should be shared
3. Use tools like knip to find all unused code and remove, ensuring that it's actually not referenced anywhere
4. Untangle any circular dependencies, using tools like madge
5. Remove any weak types, for example 'unknown' and 'any' (and the equivalent in other languages), research what the types should be, research in the codebase and related packages to make sure that the replacements are strong types and there are no type issues
6. Remove all try catch and equivalent defensive programming if it doesn't serve a specific role of handling unknown or unsanitized input or otherwise has a reason to be there, with clear error handling and no error hiding or fallback patterns
7. Find any deprecated, legacy or fa
name: melo-maps
services:
osrm:
image: osrm/osrm-backend:v5.25.0
container_name: osrm
restart: unless-stopped
ports:
- '5000:5000'
volumes:
@vaso991
vaso991 / schema.ts
Created May 30, 2024 13:54
Drizzle Postgis
import { pgTable, serial, varchar, timestamp } from "drizzle-orm/pg-core";
import { models } from 'drizzle-postgis';
export const users = pgTable('users', {
id: serial('id').primaryKey(),
name: varchar('name', { length: 50 }),
location: models.point('location', { srid: 4326 }),
createdAt: timestamp('createdAt').notNull().defaultNow(),
updatedAt: timestamp('updatedAt').notNull().defaultNow().$onUpdate(() => new Date())
})
@vaso991
vaso991 / PostGISGeometryType.ts
Created January 17, 2024 17:57
MikroORM Postgis
export class Point {
constructor(lng: number, lat: number) {
this.lng = lng;
this.lat = lat;
}
lng!: number;
lat!: number;
}
export class PostGISGeometryType extends Type<Point | undefined, string> {
@vaso991
vaso991 / nginx
Last active June 14, 2026 13:14
upstream loadbalancer {
server localhost:3000;
server localhost:3001;
}
server {
listen 80;
listen [::]:80;
server_name api.example.com;
return 302 https://$server_name$request_uri;
name: Deploy Docker to server using github registry
on:
push:
branches: [main]
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
DOCKER_NAME: app-backend
name: Deploy Nodejs App On Server
on:
push:
branches:
- main
jobs:
server:
runs-on: ubuntu-latest
@vaso991
vaso991 / code.md
Created December 29, 2019 14:55 — forked from gopalindians/code.md
Jetbrains IntelliJ IDEA 2019.2.4 Activation code

Please make fork of this, as this can be removed by Github.com sooner or later.

CATF44LT7C-eyJsaWNlbnNlSWQiOiJDQVRGNDRMVDdDIiwibGljZW5zZWVOYW1lIjoiVmxhZGlzbGF2IEtvdmFsZW5rbyIsImFzc2lnbmVlTmFtZSI6IiIsImFzc2lnbmVlRW1haWwiOiIiLCJsaWNlbnNlUmVzdHJpY3Rpb24iOiJGb3IgZWR1Y2F0aW9uYWwgdXNlIG9ubHkiLCJjaGVja0NvbmN1cnJlbnRVc2UiOmZhbHNlLCJwcm9kdWN0cyI6W3siY29kZSI6IklJIiwicGFpZFVwVG8iOiIyMDIwLTAxLTA4In0seyJjb2RlIjoiQUMiLCJwYWlkVXBUbyI6IjIwMjAtMDEtMDgifSx7ImNvZGUiOiJEUE4iLCJwYWlkVXBUbyI6IjIwMjAtMDEtMDgifSx7ImNvZGUiOiJQUyIsInBhaWRVcFRvIjoiMjAyMC0wMS0wOCJ9LHsiY29kZSI6IkdPIiwicGFpZFVwVG8iOiIyMDIwLTAxLTA4In0seyJjb2RlIjoiRE0iLCJwYWlkVXBUbyI6IjIwMjAtMDEtMDgifSx7ImNvZGUiOiJDTCIsInBhaWRVcFRvIjoiMjAyMC0wMS0wOCJ9LHsiY29kZSI6IlJTMCIsInBhaWRVcFRvIjoiMjAyMC0wMS0wOCJ9LHsiY29kZSI6IlJDIiwicGFpZFVwVG8iOiIyMDIwLTAxLTA4In0seyJjb2RlIjoiUkQiLCJwYWlkVXBUbyI6IjIwMjAtMDEtMDgifSx7ImNvZGUiOiJQQyIsInBhaWRVcFRvIjoiMjAyMC0wMS0wOCJ9LHsiY29kZSI6IlJNIiwicGFpZFVwVG8iOiIyMDIwLTAxLTA4In0seyJjb2RlIjoiV1MiLCJwYWlkVXBUbyI6IjIwMjAtMDEtMDgifSx7ImNvZGUiOiJEQiIsI