Skip to content

Instantly share code, notes, and snippets.

@jbrechtel
jbrechtel / project.scala
Created January 17, 2012 23:02
sbt task dependencies in parallel vs serial
//this runs the dependencies in parallel (undesirable)
buildAndRun <<= Seq(addScalaLib, packageDebug in Android, removeScalaLib, startDevice in Android).dependOn,
---- vs ---
//this runs the dependencies serially (desired)
buildAndRun <<= removeScalaLib,
buildAndRun <<= buildAndRun dependsOn (startDevice in Android),
buildAndRun <<= buildAndRun dependsOn (packageDebug in Android),
buildAndRun <<= buildAndRun dependsOn addScalaLib,
@sadache
sadache / gist:2939230
Created June 15, 2012 23:37
Parsing progressively a csv like file with Play2 and Iteratees

If your csv doesn't contain escaped newlines then it is pretty easy to do a progressive parsing without putting the whole file into memory. The iteratee library comes with a method search inside play.api.libs.iteratee.Parsing :

def search (needle: Array[Byte]): Enumeratee[Array[Byte], MatchInfo[Array[Byte]]]

which will partition your stream into Matched[Array[Byte]] and Unmatched[Array[Byte]]

Then you can combine a first iteratee that takes a header and another that will fold into the umatched results. This should look like the following code:

// break at each match and concat unmatches and drop the last received element (the match)
@ragingwind
ragingwind / Backend Architectures Keywords and References.md
Last active July 4, 2024 13:00
Backend Architectures Keywords and References
@staltz
staltz / introrx.md
Last active November 17, 2024 01:08
The introduction to Reactive Programming you've been missing
@rklaehn
rklaehn / Client example
Last active June 8, 2020 12:38
akka http file server
package akkahttptest
import akka.http.Http
import akka.stream.ActorFlowMaterializer
import akka.actor.ActorSystem
import akka.stream.scaladsl.{Sink, Source}
import akka.http.model._
object TestClient extends App {
@17twenty
17twenty / GoWithC.go
Last active July 11, 2016 04:29
Cross Compiling and Language Interop oh my!
package main
import (
"./binding"
"fmt"
)
func main() {
binding.PrintHello()
binding.Seed(1)
fmt.Println(binding.Random())
@chinshr
chinshr / Jenkinsfile
Last active October 24, 2024 17:13
Best of Jenkinsfile, a collection of useful workflow scripts ready to be copied into your Jenkinsfile on a per use basis.
#!groovy
# Best of Jenkinsfile
# `Jenkinsfile` is a groovy script DSL for defining CI/CD workflows for Jenkins
node {
}
@cgcardona
cgcardona / ava-full-node-steps.md
Last active December 2, 2022 03:16
Steps for firing up an Avalanche full node

Steps for firing up a full Avalanche node

Avalanche is an open-source platform for launching highly decentralized applications, financial primitives, and interoperable blockchains.

These are steps for firing up an Avalanche full node on Digital Ocean.

Digital Ocean Ubuntu Instance

ssh into a Digital Ocean Ubuntu box