Skip to content

Instantly share code, notes, and snippets.

@rodrigosetti
rodrigosetti / remove-unused-imports.py
Created February 7, 2013 21:49
Removes unused imports from a bunch of Java files.
#! /usr/bin/env python
# coding: utf-8
"""This script reads all .java files from a directory tree and removes unused
import statements. It may have errors in detecting import lines (e.g. import
lines within block comments, or import lines with another statement in the same
line), and it may have false-negatives when deciding to remove an import (i.e.
it only removes if the last import symbol word doesn't appear at all -
including comments - in the code).
@rebx
rebx / gist:1250106
Created September 29, 2011 06:25
tshark'ing mysql
live:
tshark -i eth0 -aduration:60 -d tcp.port==3306,mysql -T fields -e mysql.query 'port 3306'
capture:
tcpdump -i eth0 port 3306 -s 1500 -w tcpdump.out
tshark -r tcpdump.out -d tcp.port==3306,mysql -T fields -e mysql.query > query_log.out
@doomspork
doomspork / Gemfile
Created March 1, 2013 03:59
Sample non-managed currency implementation with unit test
source :rubygems
gem 'sinatra'
gem 'trollop'
gem 'faraday'