<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config-server</artifactId>
</dependency>
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Backup | |
git ls-remote backup --quiet | |
if test $? = 0; | |
then | |
git push backup --force --all --quiet | |
echo "...Backuped" | |
else | |
echo "No Backup repository => Skip backup" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name := "Imaging" | |
version := "1.0" | |
scalaVersion := "2.10.2" | |
libraryDependencies += "org.scalatest" %% "scalatest" % "1.9.1" % "test" | |
// Scalastyle | |
org.scalastyle.sbt.ScalastylePlugin.Settings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Resolvers | |
resolvers += "sonatype-releases" at "https://oss.sonatype.org/content/repositories/releases/" | |
// Eclipse generation | |
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.2.0") | |
// IDEA generation | |
addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.5.1") | |
// Scalastyle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function(grunt) { | |
// Project configuration. | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
'compile-handlebars': { | |
all: { | |
preHTML: 'src/pre.html', | |
postHTML: 'src/post.html', | |
template: 'src/body.hbs', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case class Memo[A, B](f: A => B) extends Function1[A, B] { | |
private val cache = scala.collection.mutable.Map.empty[A, B] | |
def apply(x: A) = cache.getOrElseUpdate(x, f(x)) | |
} | |
val fibonacci: Memo[Int, Int] = Memo { | |
case 0 => 0 | |
case 1 => 1 | |
case n => fibonacci(n - 1) + fibonacci(n - 2) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
implicit class SuperNumber[A](i: A)(implicit integral: Integral[A]) { | |
import integral._ | |
import Numeric.Implicits._ | |
def squared: A = i * i | |
def pow(m: Int) = math.pow(i.toDouble(), m) | |
def **(m: Int) = pow(m) | |
def sqrt = math.sqrt(i.toDouble()) | |
def isEven = dividesBy(2) | |
def isOdd = !isEven |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DIST="dist" | |
rm -rf $DIST/* | |
mkdir $DIST | |
function download { | |
echo "download $2 --> $1" | |
if [ ! -f "$1" ]; then | |
curl --progress -L -o $1 $2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"key": "ctrl+g", | |
"command": "editor.action.addSelectionToNextFindMatch", | |
"when": "editorFocus" | |
}, | |
{ | |
"key": "cmd+shift+l", | |
"command": "HookyQR.beautify", | |
"when": "editorFocus" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const proxy = require('http-proxy-middleware'); | |
module.exports = { | |
port: 8030, | |
open: false, | |
server: { | |
middleware: proxy('/api', { target: 'http://localhost:8000/' }) | |
} | |
}; |
OlderNewer