# Edit this configuration file to define what should be installed on | |
# your system. Help is available in the configuration.nix(5) man page | |
# and in the NixOS manual (accessible by running ‘nixos-help’). | |
{ config, pkgs, ... }: | |
{ | |
nix = { | |
package = pkgs.nixUnstable; | |
extraOptions = '' |
Since Golang version 1.11 this process is finally (almost) as easy as it should (!!). You can see full docs here. For older guides see here.
These are my notes, not a generic solution. They are not meant to work anywhere outside my machines. Update version numbers to whatever are the current ones while you do this.
# Base settings and GC logging | |
-server -XX:+AlwaysPreTouch # First should be default, but we make it explicit, second pre-zeroes memory mapped pages on JVM startup -- improves runtime performance | |
# -Xloggc:gc-%t.log # CUSTOMIZE LOCATION HERE - $path/gc-%t.log -- the %t in the gc log file path is so we get a new file with each JVM restart | |
-XX:NumberOfGCLogFiles=5 -XX:+UseGCLogFileRotation -XX:GCLogFileSize=20m # Limits the number of files, logs to folder | |
-XX:+PrintGC -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:+PrintHeapAtGC -XX:+PrintGCCause | |
-XX:+PrintTenuringDistribution -XX:+PrintReferenceGC -XX:+PrintAdaptiveSizePolicy # gather info on object age & reference GC time for further tuning if needed. | |
# G1 specific settings -- probably should be default for multi-core systems with >2 GB of heap (below that, default is probably fine) | |
-XX:+UseG1GC | |
-XX:+UseStringDeduplication |
In this gist I would like to describe an idea for GraphQL subscriptions. It was inspired by conversations about subscriptions in the GraphQL slack channel and different GH issues, like #89 and #411.
At the moment GraphQL allows 2 types of queries:
query
mutation
Reference implementation also adds the third type: subscription
. It does not have any semantics yet, so here I would like to propose one possible semantics interpretation and the reasoning behind it.
import akka.http.scaladsl.model.HttpHeader | |
import akka.http.scaladsl.model.HttpMethods._ | |
import akka.http.scaladsl.model.HttpResponse | |
import akka.http.scaladsl.model.headers.`Access-Control-Allow-Credentials` | |
import akka.http.scaladsl.model.headers.`Access-Control-Allow-Methods` | |
import akka.http.scaladsl.model.headers.`Access-Control-Allow-Origin` | |
import akka.http.scaladsl.model.headers.Origin | |
import akka.http.scaladsl.server.Directive0 | |
import akka.http.scaladsl.server.Directives._ | |
import akka.http.scaladsl.server.MethodRejection |
package example.statemachine | |
import scalaz.{State, Scalaz}, Scalaz._ | |
object FSM { | |
def apply[I, S](f: PartialFunction[(I, S), S]): FSM[I, S] = | |
new FSM((i, s) => f.applyOrElse((i, s), (_: (I, S)) => s)) | |
private def states[S, O](xs: List[State[S, O]]): State[S, List[O]] = | |
xs.sequence[({type λ[α]=State[S, α]})#λ, O] |
import java.sql.Connection; | |
import java.sql.ResultSet; | |
import java.sql.SQLException; | |
import java.sql.Statement; | |
import java.sql.Timestamp | |
import java.util.Date | |
import scala.slick.driver.MySQLDriver.simple._ | |
//import scala.slick.driver.H2Driver.simple._ | |
//MultipleDB examples, DAL included: https://github.com/slick/slick-examples/blob/2.0.0-M3/src/main/scala/com/typesafe/slick/examples/lifted/MultiDBExample.scala e https://github.com/slick/slick-examples/blob/2.0.0-M3/src/main/scala/com/typesafe/slick/examples/lifted/MultiDBCakeExample.scala |