Skip to content

Instantly share code, notes, and snippets.

@yoginsurya
yoginsurya / generate-env-sample.sh
Created August 9, 2025 20:13
Generate .env.sample file based on .env.local or .env file
#!/bin/bash
#
# Generates a .env.sample file from .env.local or .env.
#
# This script creates a sanitized .env.sample file for version control.
# It prioritizes .env.local as the source if it exists, otherwise it uses .env.
# The script preserves comments and empty lines but removes all values from
# key-value pairs, leaving only the keys.
#
@yoginsurya
yoginsurya / brew_autoupdate.md
Last active February 27, 2026 18:14
Automate Homebrew updates on macOS using launchd. The update script runs daily at 6:00 AM.

Automated Homebrew Updates with launchd on macOS

This Gist provides a script and a launchd configuration file to automatically update Homebrew packages and casks on a daily schedule. It uses the macOS-native launchd system, which is more reliable than cron for systems that may be asleep during a scheduled run.

Setup Instructions

  1. Create the Script:
    • Place the update_brew.sh file in a directory within your user's home folder, such as ~/bin/.
    • Make the script executable by running (mkdir -p ~/bin if you do not have this directory):