Skip to content

Instantly share code, notes, and snippets.

View hamdrew's full-sized avatar

Andrew Hoffmann hamdrew

View GitHub Profile
@hamdrew
hamdrew / README.md
Last active August 1, 2023 17:02
Git Cleanup

Git Cleanup Script

This script aims to keep a developer's clone up-to-date and tidy. It performs the following actions:

  1. Fetches and prunes from remote
  2. Checks out and updates the main branch
  3. Deletes locally merged and squashed branches.
  4. Optionally deletes merged and squashed remote branches.

Warning: This is a destructive script! Consider removing parts of the script labeled "DESTRUCTIVE".

@hamdrew
hamdrew / table_sizes.sql
Created May 13, 2022 19:02
Postgres tables by size
# Source: https://stackoverflow.com/questions/21738408/postgresql-list-and-order-tables-by-size
SELECT schema_name,
relname,
pg_size_pretty(table_size) AS size,
table_size
FROM (SELECT pg_catalog.pg_namespace.nspname AS schema_name,
relname,
pg_relation_size(pg_catalog.pg_class.oid) AS table_size
@hamdrew
hamdrew / bwuuaahhhhhh.txt
Created July 20, 2015 15:27
Emoji mind explosion
:milky_way: :fireworks: :open_mouth: :fireworks: :milky_way: