Skip to content

Instantly share code, notes, and snippets.

View djspiewak's full-sized avatar

Daniel Spiewak djspiewak

View GitHub Profile
override def foo[R](body: Foo => A)(implicit evidence$5: AsResult[R]): Result = ...
[error] /Users/daniel/Development/rr/sinks/core/src/main/scala/com/rr/sinks/sync/SyncModule.scala:29: could not find implicit value for parameter eva: scalaz.Leibniz.===[scalaz.concurrent.Task[scalaz.concurrent.Task[SyncModule.this.Block[scalaz.concurrent.Task]]],scalaz.concurrent.Task[SyncModule.this.Block[scalaz.concurrent.Task]]]
[error] (separated tee transform)(StreamUtils.throughW) mapO Task.now map { _.bisequence[Task, Block[Task], KeyExtentMessage] }
[error] ^
[error] one error found
import scalaz._
import scalaz.stream._
import scalaz.syntax.monad._
object StreamUtils {
import Process._
def throughW[W, O, A]: Tee[W \/ O, W => A, A \/ O] = repeat {
for {
i <- awaitL[W \/ O]
process, absent anything else, is strictly pull
you should think of run like a giant wheel that is spinning and pulling in some rope, which is the process
the other end of that rope MAY be attached to a queue
you're pulling from that queue
and there may be an observer sitting on the rope which pushes into another queue
sealed trait CastyClassTag[A] {
type Aux
implicit def tag: ClassTag[Aux]
def to(a: A): Aux
def from(a: Aux): A
}
private trait LowPriority {
class TestSpec extends org.specs2.mutable.Specification {
sequential // this causes the printing to break
"many tests" should {
(1 to 1000).foreach { i =>
"example "+i >> {
("example "+i).pp
Thread.sleep((math.random*100).toLong)
ok
}
"specs2-2" #106 daemon prio=5 os_prio=31 tid=0x00007fb09db02000 nid=0x701b waiting for monitor entry [0x0000000125e20000]
java.lang.Thread.State: BLOCKED (on object monitor)
at org.specs2.specification.LazyExecutingFragment.get$lzycompute(ExecutedFragment.scala:190)
- waiting to lock <0x000000076cdffa10> (a org.specs2.specification.LazyExecutingFragment)
at org.specs2.specification.LazyExecutingFragment.get(ExecutedFragment.scala:190)
at org.specs2.reporter.Statistics$$anonfun$4.apply(Statistics.scala:86)
at org.specs2.reporter.Statistics$$anonfun$4.apply(Statistics.scala:86)
at scalaz.ReducerFunctions$$anon$2.unit(Reducer.scala:172)
at scalaz.UnitReducer$$anonfun$snoc$1.apply(Reducer.scala:57)
at org.specs2.specification.Stats$StatsMonoid$.append(Stats.scala:183)

Configuring SBT to use 1Password

  1. Install swig-python
  2. Use pip to install 1pass
  3. Install py-levenshtein to avoid annoying warnings
  4. Locate the nearest 1pass script (note: it may be behind you)
  5. Test 1pass on a random password

Create ~/.sbt/0.13/plugins/build.sbt with the following contents:

Practical Cryptographic Release Branch Validation

One of the problems I've been thinking about recently is how to get reasonable cryptographic validation of release sources and artifacts without destroying usability. There are several randomly-assorted problems here:

  • SHA-1 is relatively easy to collide, and thus signed Git commits and tags are insufficient
  • Maintaining an auditable and relatively tamper-proof list of trusted signatures is hard
  • "Strong crypto" is generally (and accurately) equated with "not human usable"

Things to Sign

package scalaz.stream
package parsers
import scalaz._
import scalaz.syntax.equal._
import scalaz.syntax.monad._
import scalaz.syntax.show._
sealed trait Parser[Token, Result] {