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
connor@iota:marathon (mesos-health-checks) $ mesos cat toggle\.8214d9c7-fe2b-11e3-b172-685b35a05cac toggle.py | |
import sys | |
import SimpleHTTPServer | |
from BaseHTTPServer import BaseHTTPRequestHandler | |
import SocketServer | |
import urlparse | |
PORT = int(sys.argv[1]) | |
healthy = True |
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 sys | |
import SimpleHTTPServer | |
from BaseHTTPServer import BaseHTTPRequestHandler | |
import SocketServer | |
import urlparse | |
PORT = int(sys.argv[1]) | |
healthy = True |
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
$ http GET localhost:8080/v2/apps/my-app/ | |
HTTP/1.1 200 OK | |
Content-Type: application/json | |
Server: Jetty(8.y.z-SNAPSHOT) | |
Transfer-Encoding: chunked | |
{ | |
"app": { | |
"cmd": "python -m SimpleHTTPServer $PORT", | |
"constraints": [], |
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
$ http DELETE localhost:9000/doc | |
HTTP/1.1 200 OK | |
Content-Length: 2 | |
Server: Jetty(8.1.13.v20130916) | |
OK | |
$ http GET localhost:9000/doc | |
HTTP/1.1 200 OK | |
Content-Length: 52 |
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
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} | |
yellow=$(tput setaf 3) | |
green=$(tput setaf 2) | |
cyan=$(tput setaf 6) | |
purple=$(tput setaf 5) | |
bold=$(tput bold) | |
reset=$(tput sgr0) |
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
// Versioned | |
import scala.math.{ Ordered, Ordering } | |
import scala.collection.{ SortedSet, SortedSetLike } | |
trait Versioned[V <: Ordered[V]] { | |
val version: V | |
} | |
object Versioned { |
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
// implementation... | |
import scala.collection.mutable.{ ArrayBuffer, ObservableBuffer, Undoable } | |
import scala.collection.script.{ Message, Include } | |
import java.io.Closeable | |
import java.util.concurrent.LinkedBlockingQueue | |
/** | |
* A thread-safe, bounded, mutable event buffer. | |
*/ |
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
def collapse(s: String, target: Char): String = collapse(s.toSeq, target).mkString | |
def collapse[T](s: Seq[T], target: T): Seq[T] = s match { | |
case Seq() => Seq[T]() | |
case t0 +: t1 +: tail if t0 == target && t1 == target => | |
collapse(target +: tail, target) | |
case t +: tail => t +: collapse(tail, target) | |
} | |
/* |
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 test | |
import scala.reflect.runtime.universe._ | |
object ReflectionHelpers extends ReflectionHelpers | |
trait ReflectionHelpers { | |
protected val classLoaderMirror = runtimeMirror(getClass.getClassLoader) |
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
<repository> | |
<id>sonatype-oss-public</id> | |
<url>https://oss.sonatype.org/content/groups/public/</url> | |
<releases> | |
<enabled>true</enabled> | |
</releases> | |
</repository> | |
<dependency> | |
<groupId>org.enmas</groupId> |