I hereby claim:
- I am agemooij on github.
- I am agemooij (https://keybase.io/agemooij) on keybase.
- I have a public key ASDPU5iVgOTv_dmHI-Xf0la16UWZkfd8qxbb_YU3j1zkIAo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
node { | |
def currentVersion = getCurrentVersion() | |
def newVersion = getNextVersion(currentVersion) | |
def frontendIp = kubectl("get svc l5d -o jsonpath=\"{.status.loadBalancer.ingress[0].ip}\"").trim() | |
def originalDst = getDst(getDtab()) | |
stage("clone") { | |
git url: gitRepo + '.git', branch: gitBranch | |
} |
implicit object ProductItemFormat extends RootJsonFormat[ProductItem] { | |
// some fields are optional so we produce a list of options and | |
// then flatten it to only write the fields that were Some(..) | |
def write(item: ProductItem) = JsObject( | |
List( | |
Some("product_number" -> item.productNumber.toJson), | |
item.ean.map(ean ⇒ "ean" -> ean.toJson), | |
Some("title" -> item.title.toJson), | |
item.description.map(description ⇒ "description" -> description.toJson), | |
Some("price" -> item.price.toJson), |
# vim:ft=zsh ts=2 sw=2 sts=2 | |
# | |
# Age's version of Agnoster's Theme - https://gist.github.com/3712874 | |
# A Powerline-inspired theme for ZSH | |
# | |
# # README | |
# | |
# In order for this theme to render correctly, you will need a | |
# [Powerline-patched font](https://github.com/Lokaltog/powerline-fonts). | |
# |
package rfs.rebb | |
package common | |
/** | |
* Performs standard Java/unicode normalization on the trimmed and lowercased form | |
* of the input String and then adds a few extra tricks for dealing with special | |
* characters. | |
* | |
* JVM/Unicode normalization references (warning: learning curve black hole, beware!): | |
* |
A heavily customied SBT shell prompt that shows the following information:
package scalapenos.spray.auth | |
import spray.routing._ | |
import spray.routing.Directives._ | |
import spray.http.HttpHeaders._ | |
import spray.http.StatusCodes._ | |
trait HttpsDirectives { | |
import HttpsDirectives._ |
def addItem(newItem: BasketItem): BasketState = { | |
copy( | |
items.foldRight((false, List.empty[BasketItem])) { | |
case (item, (_, out)) if (item.matchesProductAndSizeOf(newItem)) ⇒ (true, item.incrementNumberBy(newItem.numberOfProducts) :: out) | |
case (item, (didSomethingMatch, out)) ⇒ (didSomethingMatch, item :: out) | |
} match { | |
case (false, _) ⇒ newItem :: items | |
case (true, modifiedItems) ⇒ modifiedItems | |
} | |
) |
/** | |
* Amazon S3 uploads and downloads need to have an authorization header containing a signature based on a very specific formatting | |
* of several of the headers of the HTTP request. This method only implements the parts that are required for our use cases, | |
* thus very specific situations like headers spanning multiple lines are not supported. | |
* For the details of the string-to-sign that is constructed see http://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html?r=1821 | |
*/ | |
def signAwsRequest(method: String, dateString: String, contentType: String, bucket: String, resource: String, amzHeaders: List[HttpHeader] = List.empty[HttpHeader], contentMd5: String = ""): String = { | |
val bucketResource = s"/$bucket$resource" | |
val signableAmzHeaders = amzHeaders.sortBy(_.name).map { header ⇒ |
This code was quickly ripped out of an active project to serve as an example. It will not compile in any way!
Any questions? Add them to the comments!