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 janrain | |
object Thing { | |
def run = println(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
In the block passed to Curl::Easy: | |
e.g. {|curl| | |
curl.verbose = true | |
} | |
Logs headers only, not body. |
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/local/rvm/gems/ree-1.8.7-2010.02/gems/memcache-client-1.5.0/lib/memcache.rb.orig 2011-12-16 14:44:29.806155993 -0800 | |
+++ /usr/local/rvm/gems/ree-1.8.7-2010.02/gems/memcache-client-1.5.0/lib/memcache.rb 2011-12-16 16:51:26.468961991 -0800 | |
@@ -4,6 +4,7 @@ | |
require 'thread' | |
require 'timeout' | |
require 'rubygems' | |
+require 'base64' | |
class String | |
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 'jruby-spymemcached' | |
class SpymemcachedWrapper | |
# Shamelessly cribbed from | |
# https://github.com/ikai/jruby-memcache-client/blob/master/lib/memcache.rb | |
def initialize(servers, opts) | |
@spymemcached = Spymemcached.new(servers) | |
at_exit { @spymemcached.shutdown } |
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
Apr 3 17:24:15 tomcat5-prod.engage-cloud.com #011at java.net.SocketInputStream.socketRead0(Native Method) | |
Apr 3 17:24:15 tomcat5-prod.engage-cloud.com #011at java.net.SocketInputStream.read(SocketInputStream.java:150) | |
Apr 3 17:24:15 tomcat5-prod.engage-cloud.com #011at java.net.SocketInputStream.read(SocketInputStream.java:121) | |
Apr 3 17:24:15 tomcat5-prod.engage-cloud.com #011at sun.security.ssl.InputRecord.readFully(InputRecord.java:312) | |
Apr 3 17:24:15 tomcat5-prod.engage-cloud.com #011at sun.security.ssl.InputRecord.read(InputRecord.java:350) | |
Apr 3 17:24:15 tomcat5-prod.engage-cloud.com #011at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:894) | |
Apr 3 17:24:15 tomcat5-prod.engage-cloud.com #011at sun.security.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:851) | |
Apr 3 17:24:15 tomcat5-prod.engage-cloud.com #011at sun.security.ssl.AppInputStream.read(AppInputStream.java:102) | |
Apr 3 17:24:15 tomcat5-prod.engage-cloud.com #011at org.apache.http.impl.io.AbstractSessionInputBuffer.fillBuf |
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 foo | |
class Crash { | |
def foo = | |
try | |
err | |
catch { | |
case e:Exception => | |
e.printStackTrace | |
} |
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
def sql[T](q: String)(f: ResultSet => T): Either[List[Throwable], T] = (for { | |
connection <- managed( datasource.getConnection ) | |
statement <- managed( connection.createStatement ) | |
resultSet <- managed( statement.executeQuery(q) ) | |
} yield resultSet).acquireFor(f) |
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.scalatra | |
package liftjson | |
import scala.xml.XML | |
import net.liftweb.json._ | |
import net.liftweb.json.Xml.toXml | |
trait JsonSupport extends ApiFormats { | |
/** |
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.scalatra | |
package liftjson | |
import scala.xml.XML | |
import net.liftweb.json._ | |
import net.liftweb.json.Xml.toXml | |
trait JsonSupport extends ApiFormats { | |
/** |
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 net.liftweb.json.{Extraction, DefaultFormats} | |
object Main { | |
implicit val formats = DefaultFormats | |
val p = Person("Leif", 33) | |
def main(args:Array[String]) { | |
val dp = Extraction decompose p |
OlderNewer