Skip to content

Instantly share code, notes, and snippets.

View ngzax's full-sized avatar
😎
founding & developing

Daryl Richter ngzax

😎
founding & developing
View GitHub Profile
@ngzax
ngzax / git-log-watch
Created March 27, 2026 13:57
A simple TUI for viewing your decorated git log
#!/usr/bin/env bash
last_hash=""
while true; do
clear
if [[ -n "$TMUX" ]]; then
cols=$(tmux display-message -p '#{pane_width}')
lines=$(( $(tmux display-message -p '#{pane_height}') - 2 ))
else
@ngzax
ngzax / index_dupes.sql
Last active August 29, 2015 14:06 — forked from jberkus/gist:e4cadd6b8877c3bc59c8
Finds duplicate indexes on a PostgreSQL DB
-- check for exact matches
WITH index_cols_ord as (
SELECT attrelid, attnum, attname
FROM pg_attribute
JOIN pg_index ON indexrelid = attrelid
WHERE indkey[0] > 0
ORDER BY attrelid, attnum
),
index_col_list AS (
SELECT attrelid,
foreach ($array as $key => $value) {
if (is_null($value) || $value=="") {
unset($array[$key]);
}
}