This file contains hidden or 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
| GitHub Pages URLs on an Enterprise instance take the form of http(s)://[hostname]/pages/[user]/[repo] |
This file contains hidden or 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
| -Xms1024m | |
| -Xmx2048m | |
| -XX:MaxPermSize=512m | |
| -XX:ReservedCodeCacheSize=128m | |
| -XX:+UseCodeCacheFlushing | |
| -XX:+UseCompressedOops | |
| -server | |
| -XX:NewSize=128m | |
| -XX:+UseParNewGC | |
| -XX:ParallelGCThreads=8 |
This file contains hidden or 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
| package scalawebserver | |
| import java.net._ | |
| import com.sun.net.httpserver._ | |
| class Handler extends HttpHandler { | |
| import java.io._ | |
| import java.nio._ | |
| import scala.io.Source |
This file contains hidden or 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
| These additional/replacement JVM arguments for Eclipse seem to work pretty well. | |
| I believe I got them from a blog at some point, but no idea where. | |
| Please backup your original config and change at your own peril. | |
| -XX:MaxPermSize=512m | |
| -Xms40m | |
| -Xmx2048m | |
| -XX:+UseParallelGC |
This file contains hidden or 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
| package your.mom | |
| import net.liftweb.http.{S, HeaderDefaults, InMemoryResponse, LiftResponse} | |
| import net.liftweb.json.JsonAST.JValue | |
| import net.liftweb.json._ | |
| // This is much nicer to use than the native JsonResponse in Lift | |
| case class WrappedLiftJsonResponse(json: JValue, statusCode: Int, respHeaders: List[(String, String)] = Nil) extends LiftResponse with HeaderDefaults { | |
| val headerContentType = "Content-Type" | |
| val headerJsonContentValue = "application/json" |
This file contains hidden or 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
| def doSomething() = { | |
| val s = System.nanoTime | |
| // do stuff here | |
| println("time: "+(System.nanoTime-s)/1e6+"ms") | |
| } |
This file contains hidden or 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 += Resolver.url("artifactory", url("http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-releases"))(Resolver.ivyStylePatterns) |
This file contains hidden or 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
| // flatMap | |
| // This code is equivalent to: | |
| // option.flatMap(foo(_)) | |
| option match { | |
| case None => None | |
| case Some(x) => foo(x) | |
| } | |
| // flatten | |
| // This code is equivalent to: |
This file contains hidden or 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
| * g o a t s e x * g o a t s e x * g o a t s e x * | |
| g g | |
| o / \ \ / \ o | |
| a| | \ | | a | |
| t| `. | | : t | |
| s` | | \| | s | |
| e \ | / / \\\ --__ \\ : e | |
| x \ \/ _--~~ ~--__| \ | x | |
| * \ \_-~ ~-_\ | * | |
| g \_ \ _.--------.______\| | g |
This file contains hidden or 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
| package devnulled; | |
| import java.util.Date; | |
| import java.util.regex.Matcher; | |
| import java.util.regex.Pattern; | |
| public class DateTimeUtils { | |
| /** | |
| * <p> | |
| * Parses a Microsoft .NET style JSON timestamp and returns a Java Date irrespective of time zones (but can parse them) |