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
package tests | |
import com.twitter.finagle.builder.ClientBuilder | |
import com.twitter.finagle.http.Http | |
import com.twitter.finatra.httpclient.RequestBuilder | |
import com.twitter.util.{Await, Future} | |
import org.junit.runner.RunWith | |
import org.scalatest.junit.JUnitRunner | |
import org.scalatest.{BeforeAndAfterAll, FlatSpec, Matchers} |
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
@RunWith(classOf[JUnitRunner]) | |
class ClientObjectTests extends FlatSpec with Matchers with BeforeAndAfterAll { | |
"A client" should "be closeable" in { | |
val client = | |
ClientBuilder() | |
.dest("localhost:1") | |
.codec(Http()) | |
.hostConnectionLimit(1) | |
.build() |
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
// finagle 6.1.33 | |
class ClientObjectTests extends FlatSpec with Matchers with BeforeAndAfterAll { | |
"A client" should "be closeable" in { | |
val client = | |
ClientBuilder() | |
.dest("localhost:1") | |
.codec(Http()) | |
.hostConnectionLimit(1) | |
.build() |
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
" nerdtree mapping | |
map <F3> :NERDTreeToggle<CR> | |
" enabled mouse | |
set mouse=a | |
" enable osx clipboard | |
set clipboard=unnamed |
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
public enum Mode { | |
Gen0, | |
Gen1 | |
} | |
//============================= | |
@Data | |
@EqualsAndHashCode(of = "id") | |
public class Node { |
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 Foo where | |
import Control.Monad | |
import Common.Utils | |
import Data.List | |
import Data.Maybe | |
newtype Price = Price { getPrice :: Float } deriving (Show, Eq) | |
data Buyable = Meat | Fruit deriving (Show, Eq) |
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
open System | |
type Percent = double | |
type Money = double | |
type Nth = int | |
type ProductType = | |
| Apple | |
| Orange | |
| Poo |
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
public class StreamUtil<T>{ | |
public static <T> Stream<T> ofIterable(Iterable<T> iter){ | |
Iterator<T> iterator = iter.iterator(); | |
Stream.Builder<T> builder = Stream.builder(); | |
while(iterator.hasNext()){ | |
builder.add(iterator.next()); | |
} |
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 x | |
let list = [-1;0;1;2;3;4;5;6;7;8;9] |> List.toArray | |
let target = [1;2;3] |> List.toArray | |
let nope = [4;1;2] |> List.toArray | |
/// <summary> | |
/// Sequenes are basically IEnumerable, so you can't do structural equality on them | |
/// this is why they are converted to an F# list before doing comparison, otherwise | |
/// their references are compared |
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
let result = test parserStream video | |
let moov = List.find(function | MOOV(x) -> true | _ -> false) result | |
let sttsElements = | |
match moov with | |
| MOOV(l) -> | |
List.filter (function | TRAK(_) -> true | _ -> false) l | |
|> List.map (function | TRAK(l) -> l) | |
|> List.collect id |