Skip to content

Instantly share code, notes, and snippets.

Setup new Mac with OSX Lion from scratch

These commands are good as of 2013-06-03.

Install xcode

The download/install takes awhile so start it first. When it finishes downloading you will still need to run it to complete installation.

Really the nicest choice for a terminal on OSX right now, especially with Lion style full screen support.

@jackrabb1t
jackrabb1t / GetMethodNameUsingStackTrace.java
Created November 28, 2011 17:59
Get the method name from the stack trace
/**
* Get the method name for a depth in call stack. <br />
* Utility function
* @param depth depth in the call stack (0 means current method, 1 means call method, ...)
* @return method name
* http://stackoverflow.com/questions/421280/in-java-how-do-i-find-the-caller-of-a-method-using-stacktrace-or-reflection
*/
public static String getMethodName(final int depth)
{
final StackTraceElement[] ste = Thread.currentThread().getStackTrace();
@jackrabb1t
jackrabb1t / CollectionsPredicateFilterSample.java
Created November 18, 2011 13:47
a snippet to filter a list - using apache commons collections Predicate class
import static java.lang.System.out;
import static java.util.Arrays.asList;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.Predicate;
public class ListTests {
public static void main( String[] args ) {
List<String> names = asList( "Ted", "Fred", "Jed", "Ned" );
@jackrabb1t
jackrabb1t / gitCommitSnippet.sh
Created October 27, 2011 12:38
a simple script that will accept parameters and add them to a git commit message;
function gcm {
echo "Enter commit string:"
read cstr
cs=\""$cstr\""
echo $cs
echo "git commit -m `echo $cs`"
#`git commit -m `echo $cs``
`git commit -m $cs`
}