Skip to content

Instantly share code, notes, and snippets.

View peshkov3's full-sized avatar
πŸš€

Peshkov Maxim peshkov3

πŸš€
  • Finverity
  • UK
View GitHub Profile
@peshkov3
peshkov3 / 1-primary-generated-uuid-v7.decorator.ts
Created February 19, 2026 07:44
UUID v7 for PostgreSQL + TypeORM β€” decorator, migration, and entity usage
import { PrimaryColumn } from 'typeorm';
/**
* TypeORM decorator that generates UUID v7 primary keys using a PostgreSQL function.
* UUID v7 is time-sortable, giving better B-tree index performance than UUID v4.
*
* Requires the `uuid_generate_v7()` function to exist in your database β€” see the
* companion migration file.
*/
export function PrimaryGeneratedUuidV7Column(options?: { primaryKeyConstraintName?: string }): PropertyDecorator {
@peshkov3
peshkov3 / Sync Metabase State.yml
Created November 18, 2025 18:00
Metabase Sync State Github Action
name: Metabase Sync (Direct Environment-to-Environment)
on:
workflow_dispatch:
inputs:
source_environment:
description: 'Source environment to export from'
type: environment
required: true
target_environment:
@peshkov3
peshkov3 / validator.js
Last active April 17, 2018 10:34
nodejs-validator
import * as changeCase from 'change-case';
// Laravel's like node js request data validator
// Usage:
//
// let v = new Validator(body, {
// index: 'required|string',
// lang: 'string',
// code: 'required|number',
// phone_number: 'required|string|regex:/^\\+?[1-9]\\d{1,14}$/',