Skip to content

Instantly share code, notes, and snippets.

@dnywh
dnywh / shrinkvid.zsh
Last active December 26, 2025 02:28
Batch shrink videos with ffmpeg.
# shrinkvid - batch shrink videos with ffmpeg
# --------------------------------------------
# Usage:
# shrinkvid [directory] [format] [crf]
#
# Examples:
# shrinkvid # defaults: ~/Downloads, mp4, CRF=25
# shrinkvid . mp4 25 50 # 50% size
# shrinkvid ~/Movies # custom directory
# shrinkvid . mkv 24 # current dir, mkv files, CRF=24
@tomaspozo
tomaspozo / lovable-knowledge.md
Last active May 15, 2025 00:45
Lovable + Supabase knowledge to avoid common errors

Supabase onAuthStateChange considerations

Whenever you need to add some logic under supabase.auth.onAuthStateChange, make sure to consider Supabase docs regarding this: https://supabase.com/docs/reference/javascript/auth-onauthstatechange

Specially the warning about not using an async function as its callback:

Important: A callback can be an async function and it runs synchronously during the processing of the changes causing the event. You can easily create a dead-lock by using await on a call to another method of the Supabase library.

  • Avoid using async functions as callbacks.
  • Limit the number of await calls in async callbacks.
  • Do not use other Supabase functions in the callback function. If you must, dispatch the functions once the callback has finished executing. Use this as a quick way to achieve this: