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
/** | |
* Created by sscarduzio on 15/05/2016. | |
*/ | |
package free | |
object Main extends App { | |
// Algebra | |
sealed trait KVStoreA[A] |
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
// Proposed code | |
override def receive: Receive = { | |
// ... snip ... | |
for { | |
indexed <- Future.sequence(batch.map { | |
case (_, f) => | |
if (!f.exists()) Future.successful(f -> Nil) | |
else searchService.extractSymbolsFromClassOrJar(f).map(f ->) | |
}) | |
.recoverWith { case t: Throwable => log.error(s"failed to index batch of ${batch.size} files", t); Future.failed(t)} |
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 test | |
import scala.util.Try | |
import scalaz._ | |
import scalaz.std.option._ | |
import scalaz.std.list._ | |
sealed trait CoPConst { | |
type Point[A] | |
} |
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
<dependencies> | |
<dependency> | |
<groupId>org.elasticsearch</groupId> | |
<artifactId>elasticsearch</artifactId> | |
<version>${elasticsearch.version}</version> | |
<scope>compile</scope> | |
</dependency> | |
<dependency> | |
<groupId>net.java.dev.jna</groupId> | |
<artifactId>jna</artifactId> |
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
#!/bin/bash | |
#------------------------------------------------------------------------------ | |
# Name: sbtmkdirs | |
# Purpose: Create an SBT project directory structure with a few simple options. | |
# Author: Alvin Alexander, http://alvinalexander.com | |
# Info: http://alvinalexander.com/sbtmkdirs | |
# License: Creative Commons Attribution-ShareAlike 2.5 Generic | |
# http://creativecommons.org/licenses/by-sa/2.5/ | |
#------------------------------------------------------------------------------ |
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
#!/bin/bash | |
### NB: This script assumes you have set up your project in virtualenv! | |
# Configure here your python script with dependencies | |
ACTUAL_PYTHON_SCRIPT=rss.py | |
WORKDIR_SUFFIX="__LAMBDA_PACK_SCRIPT" | |
rm -rf $TMPDIR/*$WORKDIR_SUFFIX | |
WORKDIR=`mktemp -d --suffix $WORKDIR_SUFFIX` |
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 org.joda.time.format.DateTimeFormat | |
import org.joda.time._ | |
import scala.annotation.tailrec | |
val timeWindow: Seconds = Seconds.seconds(Hours.hours(12).toStandardSeconds.getSeconds) | |
type Delta = (DateTime, DateTime) | |
def splitInterval(from: DateTime, to: DateTime, interval: Seconds): Seq[Delta] = { | |
@tailrec | |
def loop(_from: DateTime, intervalList: Seq[Delta]): Seq[Delta] = { |
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
/** | |
* Created by sscarduzio on 16/10/2014. | |
*/ | |
object Scalaz extends App { | |
import scalaz.stream._ | |
import scalaz.concurrent.Task | |
def fahrenheitToCelsius(d:Double) : Double = { | |
3d // who cares about actually converting.. |
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
#!/bin/bash | |
# CONF | |
DBG=true | |
RELOG_UNAME=your@email.com | |
RELOG_PASSW=xxxxxxxxxxxxxxx | |
# END CONF |
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
@Test | |
public final void testPubSubPongBug() throws Throwable{ | |
final Jedis c = pool.getResource(); | |
final String psubMessage = "bang"; | |
JedisPubSub jps = new JedisPubSub() { | |
@Override | |
public void onUnsubscribe(String channel, int subscribedChannels) {} | |
@Override | |
public void onSubscribe(String channel, int subscribedChannels) {} |