Skip to content

Instantly share code, notes, and snippets.

View brianm's full-sized avatar
Caffeinating

Brian McCallister brianm

Caffeinating
View GitHub Profile
public class Waffle
{
public static void main(String[] args) {
λ();
}
public static void λ() {
System.out.println("hee hee ;-)");
}
<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 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) {
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
{
def foo
# @cr BITCH-1 brianm should consider using '' instead of "" for performance
puts "hello world"
end
#!/bin/sh
exec foo $0 $@
!#
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>$
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 {
import java.util.Map;
import java.util.LinkedHashMap;
public class Collectiony
{
public static <T> Map<T, T> LHMap(T... elements)
{
LinkedHashMap<T, T> rs = new LinkedHashMap<T, T>();
for (int i = 0; i < elements.length; i += 2) {
rs.put(elements[i], elements[1+1]);
#!/usr/bin/env ruby
class Magic
def initialize parents=nil, name=nil, args=nil
@args, @path = args, if parents then
"#{parents}.#{name}"
else
name