Skip to content

Instantly share code, notes, and snippets.

View vergenzt's full-sized avatar

Tim Vergenz vergenzt

  • Jacksonville, FL
  • 18:28 (UTC -04:00)
View GitHub Profile
@vergenzt
vergenzt / require-clean-work-tree
Created November 21, 2017 18:14 — forked from ssbarnea/require-clean-work-tree
require-clean-work-tree is a bash script that will prevent you from doing things if your working tree is dirty. It will detect your scm and return false if detection fails or the tree is dirty. Currently it supports only git and mercurial but we can add other scm later like svn or perforce.
#!/bin/bash
# version: 1.0
# author: Sorin Sbarnea
require_clean_work_tree_git () {
git rev-parse --verify HEAD >/dev/null || exit 1
git update-index -q --ignore-submodules --refresh
err=0
if ! git diff-files --quiet --ignore-submodules
#!/bin/bash
# Georgia Tech Printer Setup Script
# Compatible with most Linux-based systems
# Requires a recent version of CUPS
# Written by Siddu Duddikunta <siddu@siddu.me>
fail()
{
echo '[FAILED]'
#!/usr/bin/env python
# A simple Python script to convert csv files to sqlite (with type guessing)
#
# @author: Rufus Pollock
# Placed in the Public Domain
import csv
import sqlite3
def convert(filepath_or_fileobj, dbpath, table='data'):
if isinstance(filepath_or_fileobj, basestring):
@vergenzt
vergenzt / lastDays.sh
Created June 25, 2012 14:42 — forked from juanpabloaj/lastDays.sh
git: latest changes grouped by day
#!/bin/bash
for i in $(seq 0 10)
do
date=$(date --date="$i days ago" +%D)
first=$(git log --format="%h" --after="$date 00:00" --before="$date 23:59" | tail -n1)
last=$(git log --format="%h" --after="$date 00:00" --before="$date 23:59" | head -n1)
if [ -n "$first" ] && [ -n "$last" ]; then
diff=$(git diff --shortstat $first^..$last)
echo "$(date --date=$date): $diff"
else