Edgaras profile
Edgaras Benediktavičius
Product designer and web developer

Code Snippets

TypeScript

Template Literal types:

type hue = 'red' | 'blue'
type step = '300' | '500' | '700'
type color = `text-${hue}-${step}`

Supabase

For adding an automatic updated_at column (by riderx):

  1. Allow moddatetime in Extensions
  2. Add updated_at column to a table, timestamptz type, default now() value
  3. Run sql command:
create trigger handle_updated_at before update on [TABLENAME]
for each row execute procedure moddatetime (updated_at);