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 'org-ruby' | |
module Jekyll | |
class OrgModeConverter < Converter | |
safe true | |
priority :low | |
def matches(ext) | |
ext =~ /org/i |
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
package org.skife.sand; | |
import java.lang.reflect.InvocationTargetException; | |
import java.lang.reflect.Method; | |
import java.lang.reflect.Modifier; | |
import java.util.Comparator; | |
import java.util.Map; | |
import java.util.SortedMap; | |
import java.util.TreeMap; | |
import java.util.concurrent.Semaphore; |
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
package com.ning.http.client.fancy; | |
import com.ning.http.client.AsyncHandler; | |
import com.ning.http.client.AsyncHttpClient; | |
import com.ning.http.client.HttpResponseBodyPart; | |
import com.ning.http.client.HttpResponseHeaders; | |
import com.ning.http.client.HttpResponseStatus; | |
import com.ning.http.client.Response; | |
import org.apache.log4j.BasicConfigurator; | |
import org.mortbay.jetty.Connector; |
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
package com.ning.http.client.fancy; | |
import com.ning.http.client.AsyncHttpClient; | |
import com.ning.http.client.Response; | |
import org.apache.log4j.BasicConfigurator; | |
import org.mortbay.jetty.Connector; | |
import org.mortbay.jetty.Handler; | |
import org.mortbay.jetty.Server; | |
import org.mortbay.jetty.handler.AbstractHandler; | |
import org.mortbay.jetty.nio.SelectChannelConnector; |
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
package org.skife.jdbi.v2.unstable.async; | |
import org.skife.jdbi.derby.Tools; | |
import org.skife.jdbi.v2.DBI; | |
import org.skife.jdbi.v2.DBITestCase; | |
import org.skife.jdbi.v2.Handle; | |
import org.skife.jdbi.v2.tweak.HandleCallback; | |
import org.skife.jdbi.v2.util.StringMapper; | |
import java.util.concurrent.CountDownLatch; |
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
// okay java trivia weenies, which asserts pass, which fail? | |
Integer foo = 42; | |
Integer bar = 42; | |
assert foo <= bar; | |
assert foo >= bar; | |
assert foo == bar; | |
foo = 1000; |
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
class Canine | |
VERSION = '1.3' | |
def initialize(&block) | |
@commands = Hash.new | |
@default = @latest = :commands | |
@empty = nil | |
@auto = { | |
:commands => hash_command("commands","Show a list of commands",Proc.new { | |
@commands.each { |cmd| c = cmd[1] | |
name = c[:name].to_s |
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
#!/usr/bin/env ruby | |
require 'optparse' | |
require 'logger' | |
require 'open-uri' | |
begin | |
require 'active_resource' | |
rescue LoadError => e | |
# active_resource has probably been installed via rubygems | |
# which, of course, does not put it on the search path |
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
#!/usr/bin/env ruby | |
class Magic | |
def initialize parents=nil, name=nil, args=nil | |
@args, @path = args, if parents then | |
"#{parents}.#{name}" | |
else | |
name |
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 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]); |