Skip to content

Instantly share code, notes, and snippets.

View tbmreza's full-sized avatar
🎯
Focusing

Reza tbmreza

🎯
Focusing
View GitHub Profile
@tbmreza
tbmreza / tricks
Last active January 25, 2025 15:14
unsorted snippets
load .env inline:
env $(cat .env | xargs) mix release
sqlite ls tables:
SELECT table_name FROM information_schema.tables WHERE table_schema = 'public’;
SELECT * FROM sqlite_master where type='table'; -- d1 ok
PRAGMA table_info(table_name);
postgres ls tables:
SELECT * FROM pg_catalog.pg_tables WHERE schemaname='public';
@tbmreza
tbmreza / helpers.rkt
Last active November 7, 2023 08:21
a growing snippet
#lang racket
(provide (all-defined-out))
(define any? any/c)
(define (until p f)
(define (go x)
(match x
[(? p x) x]
[_ (go (f x))]))
@tbmreza
tbmreza / fbt.agda
Created December 14, 2023 09:58
draft
import Relation.Binary.PropositionalEquality as Eq
open Eq using (_≡_; refl; cong; sym)
open import Data.Nat
open import Data.Bool.Base
data Tree : Set where
tempty : Tree
tnode : ℕ -> Tree -> Tree -> Tree
import Relation.Binary.PropositionalEquality as Eq
open Eq using (_≡_; refl)
open Eq.≡-Reasoning using (begin_; _≡⟨⟩_; _∎)
data ℕ : Set where
zero : ℕ
suc : ℕ → ℕ
{-# BUILTIN NATURAL ℕ #-}