This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
same as http://pastie.org/434851 but with "I'm Feeling Lucky" so you skip the search results list. | |
javascript:void(q=prompt('Java%20class%20Name:',''));if(q)void(location.href='http://www.google.com/search?q='+escape(q)+'%20site%3Ajava.sun.com%2Fjavase%2F6%2Fdocs'+'&btnI=745') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Map; | |
import static com.sun.btrace.BTraceUtils.*; | |
import com.sun.btrace.annotations.*; | |
@BTrace | |
public class ManyMethodTimerTemplate { | |
@TLS private static Map<String, Long> startTimes = newHashMap(); | |
<% targetClasses.eachWithIndex { className, classData, classIndex -> %> | |
<% classData.targetMethods.eachWithIndex { targetMethod, methodIndex -> %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
btrace { | |
templates { | |
// all methods within mydomain classes | |
methodTimerTemplate { | |
template = 'btrace-templates\\ManyMethodTimerTemplate.template' | |
targetClasses { | |
'/com\\\\.mydomain\\\\..+/' { | |
targetMethods = [ '/.+/' ] | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Provides a function that allows you to choose a JDK. Just set the environment | |
# variable JDKS_ROOT to the directory containing multiple versions of the JDK | |
# and the function will prompt you to select one. JAVA_HOME and PATH will be cleaned | |
# up and set appropriately. | |
# Usage: | |
# Include in .profile or .bashrc or source at login to get 'pickjdk' command. | |
# 'pickjdk' alone to bring up a menu of installed JDKs on OS X. Select one. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Define the project and store in a variable | |
(def project (defproject "a:b:c" | |
:dependencies ["org.clojure:clojure:1.1.0-alpha-SNAPSHOT" | |
"org.clojure:clojure-contrib:1.0-SNAPSHOT"])) | |
; Use the provided API to easily add a new dependency programatically | |
(add-dependency! project "org.testng:testng:5.10") | |
; Return the project | |
project |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<project> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.example</groupId> | |
<artifactId>shitty</artifactId> | |
<packaging>jar</packaging> | |
<version>1.0-SNAPSHOT</version> | |
<dependencies> | |
<dependency> | |
<groupId>junit</groupId> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Uses the brew or macports binaries of 'markdown'. Needs the 'markdown' executable on the $PATH. | |
INPUTFILE="$1" | |
OUTPUTFILE=`echo "$INPUTFILE" | sed "s/\.md/\.html/"` | |
echo Writing markdown file to \"$OUTPUTFILE\" | |
markdown.pl "$INPUTFILE" > "$OUTPUTFILE" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Using Git? Want to ignore changes to a noisy (e.g. tool-updated file), yet have to have it exist to satisfy said tool? | |
# Check it in once to source code control, then ignore all future changes. This option only applies to your local clone. | |
# Use this by typing 'git ignorechanges MYFILE' | |
git config --global alias.ignorechanges = update-index --assume-unchanged | |
# Use this by typing 'git noticechanges MYFILE' | |
git config --global alias.noticechanges = update-index --no-assume-unchanged | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git init testrecursiveignore | |
cd testrecursiveignore | |
mkdir target | |
echo buildjunk > target/build1.log | |
mkdir -p subproject/target | |
echo buildjunk > subproject/target/build2.log | |
echo //HelloWorld >> code/mycode.java |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rake' | |
HOME = "#{File.dirname(__FILE__)}" | |
DEST = "#{HOME}/output" | |
task :default => [:genoutputfolders] | |
task :genoutputfolders do | |
directory "output" | |
directory "#{DEST}" |