Skip to content

Instantly share code, notes, and snippets.

View devshorts's full-sized avatar

Anton Kropp devshorts

View GitHub Profile
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}
// 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()
@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()
@devshorts
devshorts / gc.java
Last active February 20, 2016 20:54
A toy generational garbage collector
public enum Mode {
Gen0,
Gen1
}
//=============================
@Data
@EqualsAndHashCode(of = "id")
public class Node {
#!/usr/bin/env bash
ENVIRONMENT=develop
MACHINE=$1
shift
function print_help(){
" nerdtree mapping
map <F3> :NERDTreeToggle<CR>
" enabled mouse
set mouse=a
" enable osx clipboard
set clipboard=unnamed
@devshorts
devshorts / gist:ab14c8cd5f72555819aa
Created March 1, 2015 21:34
Sample zsh completion for git branches you aren't on
#compdef test
local arguments
_branch(){
val=()
git branch | grep -v "\*" | while read -r branch ; do
val=($val $branch)
done
@devshorts
devshorts / gist:9241323
Last active August 29, 2015 13:56
Investigating why NUnit Assert.AreEqual doesn't work for identitical tuples with arrays
> z;;
val it : int [] * int = ([|1|], 1)
> p;;
val it : int [] * int = ([|1|], 1)
> z.Equals(p);;
@devshorts
devshorts / gist:7794811
Last active December 30, 2015 07:19
shopping 2
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)
@devshorts
devshorts / gist:7686263
Last active December 29, 2015 14:49
shopping cart question
open System
type Percent = double
type Money = double
type Nth = int
type ProductType =
| Apple
| Orange
| Poo