Skip to content

Instantly share code, notes, and snippets.

View brianm's full-sized avatar
Caffeinating

Brian McCallister brianm

Caffeinating
View GitHub Profile
def foo
# @cr BITCH-1 brianm should consider using '' instead of "" for performance
puts "hello world"
end
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
/**
* @goal art
* @phase package
*/
public class App extends AbstractMojo
{
public void testValidateOne() throws Exception {
Properties props = new Properties();
props.setProperty("foo", "-3");
Configamajig cfg = new Configamajig(props);
try {
cfg.configure(Foo.class);
fail("should have raised an exception");
}
catch (IllegalStateException e) {
<plugin>
<groupId>com.atlassian.maven.plugins</groupId>
<artifactId>jarjar-maven-plugin</artifactId>
<version>0.0.4</version>
<configuration>
<projectPackage>ning.configamajig.v1</projectPackage>
<rules>
<rule>cglib:cglib-nodep</rule>
<rule>com.google.collections:google-collections</rule>
<rule>org.antlr:stringtemplate</rule>
public class Waffle
{
public static void main(String[] args) {
λ();
}
public static void λ() {
System.out.println("hee hee ;-)");
}
public class Waffle
{
public static void main(String[] args) {
$();
}
public static void $() {
System.out.println("no way!");
}
public void testUsefulArgumentOutputForDebug() throws Exception {
try {
h.createStatement("insert into something (id, name) values (:id, :name)")
.bind("name", "brian")
.bind(7, 8)
.bindFromMap(new HandyMapThing().add("one", "two"))
.bindFromProperties(new Object())
.execute();
}
catch (StatementException e) {
@brianm
brianm / fb.hs
Created February 27, 2009 03:46
proper fibs
let fib n =
let phi = (1 + sqrt 5)/2 in
floor (((phi^n) - ((1-phi)^n)) / (sqrt 5))
open Printf
let i = int_of_string Sys.argv.(1);;
let a = ref 0 in
for j = 1 to i do
a := (!a + j)
done;
printf "%i\n" !a;;
import org.skife.jdbi.v2.tweak.Argument;
import org.skife.jdbi.v2.StatementContext;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import oracle.sql.ArrayDescriptor;
import oracle.sql.ARRAY;
/**