Skip to content

Instantly share code, notes, and snippets.

//quick hack to pretty-print some text:
"((hi)(bye(yeah))((x)))".foldLeft(0){
(a,b)=> {
var indent=a;
b match {
case '('=> println("("); indent=a+2; print(" "*indent);
case ')'=>println;indent=a-2;println(" "*indent + ")");print(" "*indent)
case x => print(x);
@indygreg
indygreg / find_old_lines.pl
Created June 17, 2012 20:17
Find oldest lines in git repository
#!/usr/bin/perl
# This script parses Git blame's "porcelain" output format and
# ascertains the oldest lines of code seen.
#
# If you want to perform a custom report, just define your own callback
# function and invoke parse_porcelain() with it.
#
# The expected input format is slightly modified from raw `git blame
# -p`. Here is an example script for producing input: