Skip to content

Instantly share code, notes, and snippets.

View saulin18's full-sized avatar
🏠
Working from home

Saúl Sondón saulin18

🏠
Working from home
View GitHub Profile
@productdevbook
productdevbook / drizzle-orm.md
Last active April 30, 2026 19:34
Drizzle ORM PostgreSQL Best Practices Guide (2025)

Drizzle ORM PostgreSQL Best Practices Guide (2025)

Latest Drizzle ORM features and optimal schema patterns

Major 2025 Update: PostgreSQL now recommends identity columns over serial types. Drizzle has fully embraced this change.

import { pgTable, integer, text, timestamp, varchar } from 'drizzle-orm/pg-core';
@leonardof02
leonardof02 / Slider.tsx
Created April 21, 2025 22:02
React Native Custom Input Slider
import React, { useEffect, useState } from "react";
import Animated, {
useSharedValue,
useAnimatedStyle,
runOnJS,
} from "react-native-reanimated";
import Ionicons from "@expo/vector-icons/Ionicons";
@cayter
cayter / LICENSE
Last active February 25, 2026 19:12
Drizzle ORM Type-Safe Repository With PgTable
MIT License
Copyright (c) 2022-present, cayter
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@abc0990cba
abc0990cba / 00-ReactToolFactory.tsx
Created March 13, 2024 15:23 — forked from mmmeff/00-ReactToolFactory.tsx
A simple Typescript-forward utility that spits out Editor.js tools for React components. You may need to include relevant Context providers for your application as wrappers around whatever <Component> is rendered by the factory
// Based on https://walkthrough.so/pblc/QCawSCKwOQLn/creating-a-custom-editorjs-block-tool-with-react
import type {
API,
BlockAPI,
BlockTool,
BlockToolConstructorOptions,
} from '@editorjs/editorjs'
import ReactDOM from 'react-dom'
@codeinthehole
codeinthehole / python-testing.md
Last active February 11, 2026 05:32
Python testing reference

Python testing reference

This document is a reference for common testing patterns in a Django/Python project using Pytest.

Contents:

@m-aciek
m-aciek / check.py
Created May 10, 2019 22:00
Alembic database freshness check.
from alembic import config
from alembic import script
from alembic.runtime import migration
import sqlalchemy
import exceptions
engine = sqlalchemy.create_engine(DATABASE_URL)
alembic_cfg = config.Config('alembic.ini')
@rushilgupta
rushilgupta / GoConcurrency.md
Last active February 9, 2026 20:17
Concurrency in golang and a mini Load-balancer

INTRO

Concurrency is a domain I have wanted to explore for a long time because the locks and the race conditions have always intimidated me. I recall somebody suggesting concurrency patterns in golang because they said "you share the data and not the variables".

Amused by that, I searched for "concurrency in golang" and bumped into this awesome slide by Rob Pike: https://talks.golang.org/2012/waza.slide#1 which does a great job of explaining channels, concurrency patterns and a mini-architecture of load-balancer (also explains the above one-liner).

Let's dig in:

Goroutines

@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active April 15, 2026 17:04
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'