I hereby claim:
- I am philwills on github.
- I am philwills (https://keybase.io/philwills) on keybase.
- I have a public key whose fingerprint is 47AC FD1A CFE0 1E18 EEED 0C84 7381 F340 9657 C301
To claim this, I am signing this object:
| import fastparse.all._ | |
| val suffix = P(" end" ~ End) | |
| val parser = P((!suffix ~ AnyChar).rep.! ~ suffix) | |
| parser.parse("start end") | |
| // fastparse.core.Parsed[String,Char,String] = Success(start,9) | |
| parser.parse("start end ") | |
| // fastparse.core.Parsed[String,Char,String] = Failure(" end":1:11 ..."") |
I hereby claim:
To claim this, I am signing this object:
| #!/bin/bash -ex | |
| # Install Git | |
| sudo yum -y install git | |
| # Install Maven | |
| wget -P /tmp http://apache.mirrors.spacedump.net/maven/maven-3/3.3.3/binaries/apache-maven-3.3.3-bin.tar.gz | |
| sudo mkdir /opt/apache-maven | |
| sudo tar -xvzf /tmp/apache-maven-3.3.3-bin.tar.gz -C /opt/apache-maven |
| package ophan | |
| object Or { | |
| type Or[T] = Either[String, T] | |
| def traverse[A,B](seq: Seq[Or[A]])(f: A => B): Or[Seq[B]] = { | |
| seq.foldLeft[Or[Seq[B]]](Right(Nil)) { (acc, or) => | |
| or match { | |
| case Left(s) => Left[String, Seq[B]](s) | |
| case Right(a) => acc.right.map(_ :+ f(a)) |
| <html> | |
| <head> | |
| <title>React Bootstrap issue - basic bootstrap</title> | |
| <script src="http://code.jquery.com/jquery-1.11.2.min.js"></script> | |
| <!-- Latest compiled and minified CSS --> | |
| <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css"> | |
| <!-- Optional theme --> | |
| <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap-theme.min.css"> | |
| <!-- Latest compiled and minified JavaScript --> | |
| <script |
| // I wanted to push my knowledge of PartialFunctions, | |
| // so this seemed fun in a twisted way | |
| // It doesn't do static exhaustiveness checking and is | |
| // probably hideously inefficient, but it was lots of fun | |
| class Matchable[A](item: A) { | |
| def poorMansMatch[B](pfs: PartialFunction[A,B]*) = { | |
| val composition = pfs.reduceLeft(_ orElse _) | |
| if (composition.isDefinedAt(item)) composition(item) |
| object FailingNumberFinder { | |
| def findMagicNumber(numbers: Seq[Int]) : Option[Int] = { | |
| for(number <- numbers) { | |
| try { | |
| return Some(SlowErrorProne.search(number)) | |
| } catch { | |
| case _ => | |
| } | |
| } | |
| return None |