This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.eod; | |
| import junit.framework.TestCase; | |
| import org.h2.jdbcx.JdbcDataSource; | |
| import org.skife.jdbi.v2.DBI; | |
| import org.skife.jdbi.v2.Handle; | |
| import org.skife.jdbi.v2.Something; | |
| import java.io.Closeable; | |
| import java.util.List; |
This file contains hidden or 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 | |
| t = <<-EOT | |
| #!/usr/bin/env ruby | |
| if 1+1 == 2 | |
| puts "hello world" | |
| end | |
| EOT | |
| # what one liner replaces '.gsub /^\s*/, "' to make this output "win" | |
| s = <<-EOB.gsub /^\s*/, "" |