I provide you with 3 jq lib functions that will help you in converting between snake_case and CamelCase.
I want to change keys in my json from camelcase to snake_case.
load.ivy("com.nimbusds" % "nimbus-jose-jwt" % "4.21") | |
load.ivy("org.bouncycastle" % "bcprov-jdk15on" % "1.51") | |
@ | |
import com.nimbusds.jose.jwk._ | |
import org.bouncycastle.util.io.pem._ | |
import java.io._ | |
def main(input: String) = { |
trait NotSubTypeOf[A, B] // encoding to capture A is not a subtype of B | |
// Note: We can use infix notation to write `A NotSubTypeOf B` instead of `NotSubTypeOf[A, B]` | |
// evidence for any two arbitrary types A and B, A is not a subtype of B | |
implicit def isSub[A, B]: A NotSubTypeOf B = null | |
// define ambigous implicits to trigger compile error in case A is a subtype of B (or A =:= B) | |
implicit def iSubAmbig1[A, B >: A]: A NotSubTypeOf B = null | |
implicit def iSubAmbig2[A, B >: A]: A NotSubTypeOf B = null |
http://angular.github.io/protractor/#/api
Note: Most commands return promises, so you only resolve their values through using jasmine expect API or using .then(function()) structure
Based on this post: https://spagettikoodi.wordpress.com/2015/01/14/angular-testing-cheat-sheet/ by @crystoll
browser.get('yoururl'); // Load address, can also use '#yourpage'
// Quasiquoted excerpt | |
def cdef = q""" | |
class $ClassName[..$classTypeParams](..$primaryParams) extends ..$classParents { | |
..$primaryAccessors | |
def get = this | |
def isEmpty = ${quasi.isEmpty} | |
def copy(..$primaryWithDefaults) = $ObjectName(..$primaryNames) |
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
package s | |
object Test { | |
// Observe that x.companion is statically typed such that foo is callable | |
def f1() = { | |
val x = new Foo | |
println(x) // Foo instance | |
println(x.companion) // Foo companion | |
println(x.companion.foo) // I'm foo! |
When times get tough and people get nasty, you’ll need more than a killer smile. You’ll need a killer contract.
Used by 1000s of designers and developers Clarify what’s expected on both sides Helps build great relationships between you and your clients Plain and simple, no legal jargon Customisable to suit your business Used on countless web projects since 2008
…………………………
object SKI_Applicative { | |
/* | |
First, let's talk about the SK combinator calculus and how it contributes to solving your problem. | |
The SK combinator calculus is made of two functions (aka combinators): S and K. It is sometimes called the SKI combinator calculus, however, the I combinator can be derived from S and K. The key observation of SK is that it is a turing-complete system and therefore, anything that can be expressed as SK is also turing-complete. Here is a demonstration that Scala's type system is turing-complete (and therefore, undecidable) for example[1]. | |
The K combinator is the most trivial of the two. It is sometimes called "const" (as in Haskell). There is also some discussion about its evaluation strategy in Scala and how to best express it[2]. The K function might be paraphrased as, "takes a value and returns a (constant) unary function that always returns that value." | |
*/ | |
def k[A, B]: A => B => A = | |
a => _ => a |