- Install IntelliJ + Scala Plugin
- Don’t do the Coursera courses yet.
- Don’t do the “red book” Functional Programming in Scala yet.
- Do: http://underscore.io/books/
- Essential Scala
- Essential Play
- Essential Slick
- Do Scala for the Impatient: https://www.amazon.com/Scala-Impatient-Cay-S-Horstmann/dp/0321774094
- The Neophyte’s Guide to Scala http://danielwestheide.com/scala/neophytes.html
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
node { | |
echo 'Results included as an inline comment exactly how they are returned as of Jenkins 2.121, with $BUILD_NUMBER = 1' | |
echo 'No quotes, pipeline command in single quotes' | |
sh 'echo $BUILD_NUMBER' // 1 | |
echo 'Double quotes are silently dropped' | |
sh 'echo "$BUILD_NUMBER"' // 1 | |
echo 'Even escaped with a single backslash they are dropped' | |
sh 'echo \"$BUILD_NUMBER\"' // 1 | |
echo 'Using two backslashes, the quotes are preserved' | |
sh 'echo \\"$BUILD_NUMBER\\"' // "1" |
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
// Inspired by a tweet from @trautonen 1/13/2016 | |
// Use Source.unfoldAsync to turn paginated database results into an akka-streams Source | |
// unfold is the inverse of fold | |
case class Page[T](pageNumber:Long, totalPages:Long, contents:List[T]) | |
case class Thing(id: Long, name: String = "foo") | |
val totalPages = 5 // | |
val pageSize = 3 |
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
/** | |
* This was something I explored today. | |
* The approach is fundamentally flawed for a couple of reasons. | |
* | |
* 1. play JSON serializes dates to strings, | |
* but they are better represented as timestamps or ISODates in mongo. | |
* | |
* 2. ObjectId's cannot be round-tripped, since they turn into JSON | |
* strings on the way out. | |
* |
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
import sbt._ | |
import Keys._ | |
import java.net._ | |
import java.io.File | |
import play.PlayRunHook | |
/* | |
Grunt runner should be in project directory to be picked up by sbt | |
*/ | |
object Grunt { |
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
#include <netdb.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <errno.h> | |
#define CANARY "in_the_coal_mine" | |
struct { | |
char buffer[1024]; |
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
/* | |
Overview | |
-------- | |
To run a query using anorm you need to do three things: | |
1. Connect to the database (with or without a transaction) | |
2. Create an instance of `anorm.SqlQuery` using the `SQL` string interpolator | |
3. Call one of the methods on `SqlQuery` to actually run the query |
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
README.txt - DIY Scala Enumeration | |
Copyright (C) 2014-2016 Jim O'Flaherty | |
Overview: | |
Provide in Scala the closest equivalent to Java Enum | |
- includes decorating each declared Enum member with extended information | |
- guarantees pattern matching exhaustiveness checking | |
- this is not available with scala.Enumeration | |
ScalaOlio library (GPLv3) which contains more up-to-date versions of both `org.scalaolio.util.Enumeration` and `org.scalaolio.util.EnumerationDecorated`: |
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
// Using vars, lots of local mutation | |
def getThemVar(th:Throwable)={ | |
var now=th | |
var li=List[Throwable](now) | |
var cause=now.getCause | |
while (cause!=null){ | |
li=cause::li | |
now=cause | |
cause=now.getCause | |
} |
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
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import subprocess | |
__all__ = ["transform"] | |
__version__ = '0.3' | |
__author__ = 'Christoph Burgmer <cburgmer@ira.uka.de>' | |
__url__ = 'http://github.com/cburgmer/upsidedown' |
NewerOlder