Skip to content

Instantly share code, notes, and snippets.

View brianm's full-sized avatar
Caffeinating

Brian McCallister brianm

Caffeinating
View GitHub Profile
HttpExchange exchange = new HttpExchange() {
private volatile int count = 0;
@Override
public InputStream getRequestContentSource() {
return new ByteArrayInputStream(new byte[0]);
}
@Override
public Buffer getRequestContentChunk() throws IOException {
brianm@kite:~/src/glitch<master>$ ruby src/ruby/glitch.rb src/ruby/glitch.rb
--
src/ruby/glitch.rb:10 : one, brianm
should this detect string vs io?
--
src/ruby/glitch.rb:22 : one, brianm
here it takes an IO, good that the name is different
from the module function
brianm@kite:~/src/glitch<master>$
#!/bin/sh
exec foo $0 $@
!#
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) {