Skip to content

Instantly share code, notes, and snippets.

View augusto-altman's full-sized avatar
😄
Coding for @joyoushq

Augusto Altman Quaranta augusto-altman

😄
Coding for @joyoushq
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

@carymrobbins
carymrobbins / pretty-print.scala
Last active January 17, 2024 14:02
Pretty print Scala case classes and other data structures.
/**
* Pretty prints a Scala value similar to its source represention.
* Particularly useful for case classes.
* @param a - The value to pretty print.
* @param indentSize - Number of spaces for each indent.
* @param maxElementWidth - Largest element size before wrapping.
* @param depth - Initial depth to pretty print indents.
* @return
*/
private def prettyPrint(a: Any, indentSize: Int = 2, maxElementWidth: Int = 30, depth: Int = 0): String = {
Windows Registry Editor Version 5.00
[-HKEY_CLASSES_ROOT\Directory\Background\shell\Cmder]
[-HKEY_CLASSES_ROOT\Directory\shell\Cmder]
@danharper
danharper / gulpfile.js
Last active April 11, 2024 08:31
New ES6 project with Babel, Browserify & Gulp
var gulp = require('gulp');
var sourcemaps = require('gulp-sourcemaps');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var browserify = require('browserify');
var watchify = require('watchify');
var babel = require('babelify');
function compile(watch) {
var bundler = watchify(browserify('./src/index.js', { debug: true }).transform(babel));
@ericelliott
ericelliott / essential-javascript-links.md
Last active July 18, 2024 15:03
Essential JavaScript Links
@matiascarranza
matiascarranza / iframe.html
Last active August 29, 2015 14:12
POST data to iframe
<iframe id="iframe" src="" class="iframe" seamless="" name="iframe"></iframe>
@asterland
asterland / 0_SourceMapFileforTranslatedLocals.json
Last active October 20, 2015 02:29
This gist covers a new addition extension to the source map specfication that would allow the resolution of local variables that have been renamed.
{
"version": 3,
"file": "example.js",
"sourceRoot": "",
"sources": ["example.ts"],
"names": ["this", "_this"],
"mappings": ";AAAA,QAAQ,CAAC,IAAI,CAAC,gBAAgB,CAAE,OAAO,EAAE;IACrC,KAAI,CAAC,WAAW,GAAG,aAAa;AACpC,CAAC,CAAC",
"x_ms_scopes": "AA>IA<",
"x_ms_locals": "AC,A"
}
@staltz
staltz / introrx.md
Last active July 22, 2024 09:31
The introduction to Reactive Programming you've been missing
@danielcompton
danielcompton / gist:6724333
Created September 27, 2013 04:53
Excel formula for calculating NZ tax paid on annual income.
=IF(B2<=14000,SUM(B2*10.5%),IF(B2<=48000,SUM(B2-14000)*17.5%+1470,IF(B2<=70000,SUM(B2-48000)*30%+7420,IF(B2>=70001,SUM(B2-70000)*33%+14020))))
@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"