Skip to content

Instantly share code, notes, and snippets.

// 3 sequential async calls
for {
aaa <- WS.url("http://aaa.com").get()
bbb <- WS.url("http://bbb.com").get()
ccc <- WS.url("http://ccc.com").get()
} yield {
// Construct th result using aaa, bbb, and ccc
}
#!/bin/bash
# create directory for python install
sudo mkdir -p /opt/bin
sudo chown -hR core:core /opt
cd /opt
# check for newer versions at http://downloads.activestate.com/ActivePython/releases/
wget http://downloads.activestate.com/ActivePython/releases/3.6.0.3600/ActivePython-3.6.0.3600-linux-x86_64-glibc-2.3.6-401834.tar.gz
tar -xzvf ActivePython-3.6.0.3600-linux-x86_64-glibc-2.3.6-401834.tar.gz
@jonjack
jonjack / create-sbt-project.sh
Last active October 6, 2017 08:37
Create a skeleton SBT project for Scala. Tested on OSX only.
#!/bin/sh
VERSION="0.1-SNAPSHOT"
SCALA_VERSION="2.12.3"
echo "Do you wish to use the current directory for the project root? (y/n)?"
echo "Note: If (n) then the project will be created in a sub-directory of the current one."
read answer
@jonjack
jonjack / GitHub.Color.Scheme.for.IntelliJ.icls
Created September 25, 2017 08:19
GitHub Color Scheme for IntelliJ
<scheme name="GitHub.Color.Scheme.for.IntelliJ" version="142" parent_scheme="Default">
<option name="FONT_SCALE" value="1.0" />
<metaInfo>
<property name="created">2017-09-15T15:53:07</property>
<property name="ide">Idea</property>
<property name="ideVersion">2017.2.4.0.0</property>
<property name="modified">2017-09-25T09:19:23</property>
<property name="originalScheme">GitHub</property>
</metaInfo>
<option name="LINE_SPACING" value="1.1" />
@jonjack
jonjack / EcTest.scala
Created August 20, 2018 23:29
Demo of specifying an explicit Execution Context to a method to override a default implicit one.
object EcTest extends App {
import scala.concurrent.Future
import scala.concurrent.ExecutionContext
import java.util.concurrent.Executors
val default = scala.concurrent.ExecutionContext.Implicits.global
def test(comp: String)(implicit exc: ExecutionContext = default): Future[String] = Future {
@jonjack
jonjack / install-java-om-mac-with-brew-&-jenv.md
Last active May 23, 2021 08:38
Install Java on Mac OSX via Home-brew

Notes on installing multiple versions Java on Mac OSX using Homebrew and Jenv.

Install Homebrew

Homebrew is a superb tool for Mac for managing the installation of software. It's core command is brew and it calls packages of software formula. If you are intrigued then you can check out the list of Formula in the brew Github repository.

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Install MySQL

See what formula are available.

brew search mysql
==> Formulae

Check whats available

brew search maven
==> Formulae
maven                maven-completion     maven-shell          maven@3.0            maven@3.1            maven@3.2            maven@3.3

Assumes High Sierra+

CMD + SHIFT + .      - shows all files/folders in Finder a window
@jonjack
jonjack / add-update-refresh-github-access-token-on-mac.md
Last active May 1, 2024 02:05
Adding & Updating GitHub Access Token on Mac

Using an Access Token for the first time

Follow the instructions on Github to Create an Access Token in Github

Configure Git to use the osxkeychain

By default, git credentials are not cached so you need to tell Git if you want to avoid having to provide them each time Github requires you to authenticate. On Mac, Git comes with an “osxkeychain” mode, which caches credentials in the secure keychain that’s attached to your system account.

You can tell Git you want to store credentials in the osxkeychain by running the following:-