This file contains hidden or 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 | |
PROJECT_NAME="$1" | |
SCALA_VERSION="2.9.1" | |
SCALATEST_VERSION="1.6.1" | |
MOCKITO_VERSION="1.8.5" | |
mkdir $PROJECT_NAME | |
cd $PROJECT_NAME | |
This file contains hidden or 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
#if ((${PACKAGE_NAME} && ${PACKAGE_NAME} != ""))package ${PACKAGE_NAME} #end | |
import org.mockito.Mockito._ | |
import org.mockito.Matchers._ | |
import org.scalatest.concurrent.ScalaFutures | |
import org.scalatest.mock.MockitoSugar | |
import org.scalatest.{Matchers, FunSpec} | |
class ${NAME} extends FunSpec with Matchers with MockitoSugar with ScalaFutures { |
This file contains hidden or 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
#if ((${PACKAGE_NAME} && ${PACKAGE_NAME} != ""))package ${PACKAGE_NAME} #end | |
import org.mockito.Mockito._ | |
import org.mockito.Matchers._ | |
import org.scalatest.concurrent.ScalaFutures | |
import org.scalatest.mock.MockitoSugar | |
import org.scalatest.{Matchers, WordSpecLike} | |
class ${NAME} extends WordSpecLike with Matchers with MockitoSugar with ScalaFutures { |
This file contains hidden or 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
#if ((${PACKAGE_NAME} && ${PACKAGE_NAME} != ""))package ${PACKAGE_NAME} #end | |
import org.scalatest.concurrent.ScalaFutures | |
import org.scalatest.{Matchers, WordSpecLike} | |
class ${NAME} extends WordSpecLike with Matchers with ScalaFutures { | |
"${NAME}" should { | |
"" in { | |
This file contains hidden or 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 | |
# Usage: init-sbt.sh my-new-project | |
PROJECT_NAME="$1" | |
SCALA_VERSION="2.11.6" | |
SCALATEST_VERSION="2.2.4" | |
mkdir $PROJECT_NAME | |
cd $PROJECT_NAME |
This file contains hidden or 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
-- /Applications/Docker/Docker\ Quickstart\ Terminal.app/Contents/Resources/Scripts/iterm.scpt | |
set itermRunning to (application "iTerm" is running) | |
set scriptPath to quoted form of POSIX path of ((path to me as text) & "::" & "start.sh") | |
set user_shell to do shell script "dscl /Search -read /Users/$USER UserShell | awk '{print $2}'" | |
tell application "iTerm" | |
activate | |
if not (exists window 1) or (itermRunning = false) then | |
reopen | |
end if |
This file contains hidden or 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 Fs2GuideApp extends App { | |
import fs2.Stream | |
import fs2.Task | |
def printTask(i: Int): Task[Boolean] = { | |
Task.delay { | |
println(s"started: $i") | |
Thread.sleep(200) | |
println(s"ended__: $i") |
This file contains hidden or 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
# Send file entries (each per line) via POST. | |
# | |
# Assumes that: | |
# - api consumes entries asynchronously, | |
# - it takes api 1s to process each entry (hence waits 25+5s after each page of 25) | |
# | |
# Replacement for: | |
# | |
# curl \ | |
# -X POST \ |
This file contains hidden or 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
# | |
# This script creates a file with entries from 'file_all_entries_path' file that are | |
# not blacklisted by entries in 'blacklisted_entries_path' file. | |
# | |
# Usage: | |
# python remove-blacklisted.py | |
import datetime | |
import time |
This file contains hidden or 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 datetime | |
import time | |
# Find out lines occurring in both "file_a" and "file_b" and print to "output-<ts>.txt" | |
def build_timestamp(): | |
t = time.time() | |
return datetime.datetime.fromtimestamp(t).strftime('%Y%m%d-%H%M%S') | |
# params |
OlderNewer