Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
function jira_issue()
{
curl -u $JIRA_USERNAME:$JIRA_PASSWORD $JIRA_BASEURL'/rest/api/2/issue/'$1
}
function jira_search()
{
curl -G -u $JIRA_USERNAME:$JIRA_PASSWORD "$JIRA_BASEURL/rest/api/2/search" --data-urlencode "jql=$1"

objects

Objects, classes, traits and case classes

Basics on classes

Use the keyword class

class Foo

val foo = new Foo

Errors

Dealing with errors in Scala.

for comprehension

Simple foreach

type Blog = Int
type BlogArticle = Int

try

Introduction to Try and IO with Scala.

Repeat Either

Either can be used for errors, but requires convention.

case class BlogNotFoundException(message: String) extends Exception(message)

Futures

Dealing with Scala's futures.

Basics

Futures integrate well into the language. We know how to create an Option and Futures should work the same.

import scala.concurrent._

Some(1)

akka

Basic introduction into the akka framework.

SBT dependency

Declare akka dependency in build.sbt

"com.typesafe.akka" %% "akka-actor" % "2.3.12"
#! /usr/bin/env bash
# Setup:
# 1. Install latest Java and Virtual Box
# 2. Install Homebrew:
# ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# 3. run script
# curl -L https://gist.githubusercontent.com/jehrhardt/d5d7e364e12e283c8949/raw/install_defaults.sh | sh
# Install Emacs via Homebrew

Setup Mac OS X

Basic instructions on setting up my Mac.

Download and install Java and Virtual Box from Oracle:

Install Homebrew

@jehrhardt
jehrhardt / README.md
Last active December 12, 2015 05:19
Steps to create an Ubuntu Precise base box for Vagrant

Following the vagrant documentation to create a new base box running Ubuntu 12.04 and Puppet requires to do a lot of single steps. Using this simple guide may help you to go through these steps much faster.

Prerequisites

You will need to install a current version of

@jehrhardt
jehrhardt / sbt.sh
Last active December 18, 2015 11:39
sbt start script to embed into a project. The script downloads the sbt launch JAR automatically, if not found.
#!/bin/sh
if [ -z "$SBT_VERSION" ]
then
SBT_VERSION=0.13.0
fi
SBT_LAUNCH_JAR=$HOME/.sbt/sbt-launch-$SBT_VERSION.jar
mkdir -p $HOME/.sbt