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
| <html> | |
| <body> | |
| GET squawk:<br /> | |
| {{ squawk_get }}<br /><br /> | |
| POST squawk:<br /> | |
| {{ squawk_post }}<br /><br /> | |
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
| %% -*- erlang-indent-level: 4;indent-tabs-mode: nil -*- | |
| %% ex: ts=4 sw=4 et | |
| %% @author Kevin Smith <kevin@opscode.com> | |
| %% @copyright 2011 Opscode, Inc. | |
| -module(example). | |
| -behaviour(gen_server). | |
| -export([start_link/0]). |
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
| // From Conceptual Mathematics and http://eed3si9n.com/learning-scalaz/Category+theory.html | |
| sealed trait Person {} | |
| case object John extends Person {} | |
| case object Mary extends Person {} | |
| case object Sam extends Person {} | |
| val a: Set[Person] = Set[Person](John, Mary, Sam) | |
| sealed trait Breakfast {} |
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
| private object DBVendor extends Logger { | |
| def apply(prefix: String) = { | |
| List("driver", "url", "user", "password").flatMap(str => Props.get(prefix + ".db." + str)) match { | |
| case driver :: url :: user :: password :: Nil => | |
| new DBVendor(driver, url, user, password, Props.get(prefix + ".db.ssl"), Props.get(prefix + ".db.sslfactory")) | |
| case _ => | |
| throw new Exception("The database connection properties could not be found.") | |
| } | |
| } | |
| } |
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
| # Get the 1.0.1 version of SSL | |
| brew install openssl | |
| ./configure --disable-hipe --enable-smp-support --enable-threads --enable-kernel-poll --enable-darwin-64bit --with-ssl=/usr/local/opt/openssl | |
| touch lib/wx/SKIP lib/odbc/SKIP | |
| make -j8 | |
| sudo make install |
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
| private object DBVendor extends Logger { | |
| def apply(prefix: String) = { | |
| List("driver", "url", "user", "password").flatMap(str => Props.get(prefix + ".db." + str)) match { | |
| case driver :: url :: user :: password :: Nil => | |
| new DBVendor(driver, url, user, password, Props.get(prefix + ".db.ssl"), Props.get(prefix + ".db.sslfactory")) | |
| case _ => | |
| throw new Exception("The database connection properties could not be found.") | |
| } | |
| } | |
| } |
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
| import scalaz.concurrent.Actor | |
| import collection.mutable.ArrayBuffer | |
| import java.util.Timer | |
| /** | |
| * Usage: | |
| * | |
| * <code> | |
| * val buffer = BufferActor[String](onFlush = _ foreach (println(_), onError = println(_)) | |
| * buffer ! "Now we're talking!" |
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 trial.scalaz | |
| package actors | |
| import java.util.concurrent.CountDownLatch | |
| import scalaz.Scalaz._ | |
| import scalaz.concurrent.Actor | |
| sealed abstract class PingPong | |
| case class Ping(sender: Actor[Pong]) extends PingPong | |
| case class Pong(sender: Actor[Ping]) extends PingPong |
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
| import java.io.IOException; | |
| import java.util.List; | |
| import org.slf4j.Logger; | |
| import org.slf4j.LoggerFactory; | |
| import junit.framework.TestCase; | |
| import com.basho.riak.client.IRiakObject; | |
| import com.basho.riak.client.builders.RiakObjectBuilder; |
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
| import akka.actor.Actor | |
| import akka.actor.ActorSystem | |
| import akka.agent.Agent | |
| import com.typesafe.config.ConfigFactory | |
| import akka.event.Logging | |
| import akka.actor.Props | |
| import kafka.utils.Utils | |
| import java.nio.ByteBuffer |