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
"test:alex": "mocha --watch 'modules/issues/test/unit/javascript/**/IssueDetailTest.js' --compilers js:babel-core/register --require ignore-styles --require ./modules/issues/test/unit/util/jsdom-setup", |
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
/** | |
* repeats a check until the check is true or the timeout is reached | |
* returns a promise that we can return to mocha | |
*/ | |
function promisePoller(condition, | |
interval = 10, | |
timeout = 1000, | |
onTimeout = new Error("Timed out")) { | |
return new Promise(function (resolve, reject) { | |
function check() { |
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
sbt "issues/test:testOnly stepdefs.RunIssuesCucumber" | |
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 org.scalatest.Assertions | |
import org.scalatest.concurrent.ScalaFutures | |
import scala.concurrent.ExecutionContext.Implicits.global | |
import scala.concurrent.Future | |
trait FutureExceptions { | |
self: Assertions with ScalaFutures => | |
def getExceptionFromFuture(future: Future[Any]): Throwable = { |
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
# | |
# Oracle Java 8 Dockerfile | |
# | |
# https://github.com/dockerfile/java | |
# https://github.com/dockerfile/java/tree/master/oracle-java8 | |
# | |
# Pull base image. | |
FROM ubuntu:15.04 |
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
; attempt 4 - using weighted quick union, always puts the smaller tree under the bigger tree to reduce depth | |
(def nodes (atom {})) | |
(def sizes (atom {})) | |
(defn find-root [i] | |
(let [v (get @nodes i)] | |
(loop [i v] | |
(if (= i v) | |
v |
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
; start a repl (lein repl) then paste in the following: | |
(defn calculate-all [input] | |
(defn calculate-item [idx item] | |
(let [split (split-at idx input) | |
actual-before (set (first split)) | |
needed-before (set (range 1 item))] | |
(clojure.set/superset? actual-before needed-before))) | |
(map-indexed calculate-item input)) |
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
Useful Wiremock Calls | |
# View all stubbed enpoints (GET) | |
http://localhost:11111/__admin/ | |
# View all requests to WM (POST) | |
http://localhost:11111/__admin/requests/find | |
body: | |
{ |
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 com.github.tomakehurst.wiremock.WireMockServer) | |
(import com.github.tomakehurst.wiremock.core.WireMockConfiguration) | |
(def wiremock-config (.port (new WireMockConfiguration) 11111)) | |
(def wiremock-server (new com.github.tomakehurst.wiremock.WireMockServer wiremock-config)) | |
(.start wiremock-server) | |
(.stop wiremock-server) |
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
echo "Cleaning up existing mysql container" | |
echo "Stopping mysql container..." | |
docker stop mysql | |
echo "Removing mysql container..." | |
docker rm mysql | |
echo "Starting mysql container..." | |
docker run --name mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=password -d mysql:5.6 |