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
/** | |
* Copyright (C) 2009-2017 Lightbend Inc. <http://www.lightbend.com> | |
*/ | |
package http | |
import java.util.concurrent.atomic.AtomicInteger | |
import akka.actor.{Actor, ActorRef, ActorSystem, Props} | |
import akka.http.scaladsl.Http | |
import akka.http.scaladsl.model.{HttpResponse, StatusCodes, Uri} |
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
object CassandraWrapper { | |
import scala.language.implicitConversions | |
import scala.language.postfixOps | |
/** | |
* Converts a `ResultSetFuture` into a Scala `Future[ResultSet]` | |
* @param f ResultSetFuture to convert | |
* @return Converted Future | |
*/ | |
implicit def resultSetFutureToScala(f: ResultSetFuture): Future[ResultSet] = { | |
val p = Promise[ResultSet]() |
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
sudo kill `ps -ax | grep 'coreaudiod' | grep 'sbin' |awk '{print $1}'` | |
# or... | |
sudo killall coreaudiod |
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
/* | |
``btn-loading`` attribute. | |
This attribute will update the button state using Twitter Bootstrap button plugin and | |
according the attribute value. | |
The attribute value should be a scope variable. | |
If the variable is ``true`` the button will have the ``loading`` state. | |
If the variable is ``false`` the button will be reset and displayed normaly. |
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
# Upstart script for a play application that binds to an unprivileged user. | |
# put this into a file like /etc/init/play.conf | |
# | |
# This could be the foundation for pushing play apps to the server using something like git-deploy | |
# By calling service play stop in the restart command and play-start in the restart command. | |
# | |
# Usage: | |
# start play | |
# stop play | |
# restart play |
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
#!/bin/bash | |
# | |
# Watch current directory (recursively) for file changes, and execute | |
# a command when a file or directory is created, modified or deleted. | |
# | |
# Written by: Senko Rasic <[email protected]> | |
# | |
# Requires Linux, bash and inotifywait (from inotify-tools package). | |
# | |
# To avoid executing the command multiple times when a sequence of |
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
#!/usr/bin/env python | |
# kd-tree index and nearest neighbour search | |
# includes doctests, run with: python -m doctest kdtree.py | |
class KDTree(object): | |
""" | |
kd-tree spatial index and nearest neighbour search | |
http://en.wikipedia.org/wiki/Kd-tree | |
""" |