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
import scala.util.Random | |
import scala.concurrent.duration._ | |
import cats.effect.{ExitCode, IO, IOApp} | |
import cats.implicits._ | |
import fs2.Stream | |
import scala.concurrent.ExecutionContext.Implicits.global | |
import java.time.{Clock, ZoneOffset} | |
import fs2.concurrent.SignallingRef |
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
; experiments on a clojure future API | |
; http/get and/post are expected to return futures | |
; create a future | |
(run (Thread/sleep 100) | |
123) | |
; => java.util.concurrent.CompletableFuture[123] | |
; supports deref, implements java.util.concurrent.Future |
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
class Foo | |
def self.call(a, b, c) | |
"#{a} #{b} #{c}" | |
end | |
end | |
Foo.(1, "foo", bar) | |
# => "1 foo :bar" |
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
val end: Sink[Foo, NotUsed] = ??? | |
val route = Flow.fromGraph(GraphDSL.create(end) { implicit builder => dest => | |
import GraphDSL.Implicits._ | |
// todo: errors, request validation, etc. | |
val entityFlow = builder.add(Flow[HttpRequest].mapAsync(1)(r => Unmarshal(r.entity).to[Foo])) | |
val responseFlow = builder.add(Flow[Foo].map(_ => HttpResponse(StatusCodes.Created))) | |
val bcast = builder.add(Broadcast[Foo](2)) |
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
Homebrew build logs for emacs on Mac OS X 10.11.6 | |
Build date: 2016-09-14 19:36:28 |
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
use std::ffi::CString; | |
use std::env; | |
use std::ptr; | |
use libc::{c_char, c_void, c_int}; | |
#[link(name="guile-2.0")] | |
extern { | |
fn scm_shell(argc: c_int, argv: *const *const c_char) -> c_void; | |
fn scm_boot_guile(argc: c_int, | |
argv: *const *const c_char, |
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
module WorkerProducer.Producer | |
open Nessos.FsPickler | |
open StackExchange.Redis | |
open System | |
open System.Text | |
open System.Threading | |
open WorkerProducer.Worker | |
let pickler = FsPickler.CreateBinary() |
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
// Learn more about F# at http://fsharp.org | |
// See the 'F# Tutorial' project for more help. | |
open Suave | |
open Suave.Json | |
open Suave.Types | |
open Suave.Types.Methods | |
open Suave.Utils | |
open Suave.Http | |
open Suave.Http.Authentication | |
open Suave.Http.Writers |
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
// Learn more about F# at http://fsharp.org | |
// See the 'F# Tutorial' project for more help. | |
open Suave | |
open Suave.Json | |
open Suave.Types | |
open Suave.Types.Methods | |
open Suave.Utils | |
open Suave.Http | |
open Suave.Http.Authentication | |
open Suave.Http.Writers |
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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<title>asdf asdf asdf asdf</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
</head> | |
<body> | |
<!-- { body: cont } from gulpfile.js:41 is rendered here --> |
NewerOlder