Skip to content

Instantly share code, notes, and snippets.

View consbulaquena's full-sized avatar
🏠
Working from home

Cons Bulaqueña consbulaquena

🏠
Working from home
View GitHub Profile

Getting Started in Scala

This is my attempt to give Scala newcomers a quick-and-easy rundown to the prerequisite steps they need to a) try Scala, and b) get a standard project up and running on their machine. I'm not going to talk about the language at all; there are plenty of better resources a google search away. This is just focused on the prerequisite tooling and machine setup. I will not be assuming you have any background in JVM languages. So if you're coming from Python, Ruby, JavaScript, Haskell, or anywhere…  I hope to present the information you need without assuming anything.

Disclaimer It has been over a decade since I was new to Scala, and when I was new to Scala, I was coming from a Java and Ruby background. This has probably caused me to unknowingly make some assumptions. Please feel free to call me out in comments/tweets!

One assumption I'm knowingly making is that you're on a Unix-like platform. Sorry, Windows users.

Getting the JVM

Go vs. Scala (Akka) Concurrency

A comparison from 2 weeks using Go.

Actors vs. Functions

Akka's central principle is that there you have an ActorSystem which runs Actors. An Actor is defined as a class and it has a method to receive messages.

(defn tree-to-list [tree root-id root-key]
(flatten (cons
(get tree root-id)
(map
(fn [filter-result]
(tree-to-list
tree
(first filter-result)
root-key))
(filter-by-parent tree root-key root-id)))))
@keith
keith / link.sh
Last active December 22, 2016 13:35
Build to iOS 10 from Xcode 7.3.1
@asciimike
asciimike / AppDelegate.swift
Last active July 12, 2021 21:56
Zero to App: Develop with Firebase (for iOS - Google I/O 2016)
///
// AppDelegate.swift
// ZeroToApp
//
import UIKit
import Firebase
import FBSDKCoreKit
@UIApplicationMain
OpenBSD 5.9 (GENERIC.MP) #163: Wed Feb 17 22:48:13 CET 2016
mike@esdenera.com:/usr/obj/sys/arch/amd64/compile/GENERIC.MP
real mem = 520028160 (495MB)
avail mem = 500105216 (476MB)
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.3 @ 0xf8ec0 (216 entries)
bios0: vendor American Megatrends Inc. version "090006" date 05/23/2012
bios0: Microsoft Corporation Virtual Machine
@kostiakoval
kostiakoval / Valentine.swift
Created February 14, 2016 12:05
Valentine Day
import UIKit
import XCPlayground
let a = 10
let layer = CAShapeLayer()
layer.strokeColor = UIColor.redColor().CGColor
layer.fillColor = UIColor(red: 1, green: 0.33, blue: 0.33, alpha: 1).CGColor
layer.lineWidth = 12
@kharrison
kharrison / String.swift
Last active January 22, 2024 14:03
Swift String Playground Examples
// Swift Standard Librray - String
// Keith Harrison http://useyourloaf.com
// Import Foundation if you want to bridge to NSString
import Foundation
// ====
// Initializing a String
// ====
@JaviLorbada
JaviLorbada / FRP iOS Learning resources.md
Last active April 8, 2024 18:07
The best FRP iOS resources.

Videos

@bitemyapp
bitemyapp / gist:8739525
Last active May 7, 2021 23:22
Learning Haskell