Skip to content

Instantly share code, notes, and snippets.

View mattbasta's full-sized avatar
🌭
Still writing JavaScript

Matt Basta mattbasta

🌭
Still writing JavaScript
View GitHub Profile
@jberkus
jberkus / gist:6b1bcaf7724dfc2a54f3
Last active January 7, 2024 21:26
Finding Unused Indexes
WITH table_scans as (
SELECT relid,
tables.idx_scan + tables.seq_scan as all_scans,
( tables.n_tup_ins + tables.n_tup_upd + tables.n_tup_del ) as writes,
pg_relation_size(relid) as table_size
FROM pg_stat_user_tables as tables
),
all_writes as (
SELECT sum(writes) as total_writes
FROM table_scans
@treo
treo / codegen.py
Created September 29, 2011 11:26 — forked from mattbasta/codegen.py
A module to "unparse" a Python AST tree.
# -*- coding: utf-8 -*-
"""
codegen
~~~~~~~
Extension to ast that allow ast -> python code generation.
:copyright: Copyright 2008 by Armin Ronacher.
:license: BSD.
"""
@nsf
nsf / clean.bash
Last active March 4, 2019 14:38
Perlin noise benchmark
#!/bin/bash
rm -rf *.o *.[568] test_*
@cvan
cvan / .bashrc
Created June 11, 2011 22:16
zamboni aliases
export ZAMBONI_PATH=~/Sites/projects/zamboni
PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]$(__git_ps1 " (%s)")\$ '
source /usr/local/etc/bash_completion.d/git-completion.bash
export WORKON_HOME=$HOME/.virtualenvs
source $HOME/.virtualenvwrapper
z() {
cd $ZAMBONI_PATH