View file.ts
// TL;DR - string enums are the easiest and most readable way to go (if you need numbers, use number sum type)
// number enum
enum ShapeNumberEnum {
Circle = 1,
Square = 2,
const a: ShapeNumberEnum = ShapeNumberEnum.Circle
const b: ShapeNumberEnum = 1 // passes type check = bad (any number will pass type checking)

Redux analysis

This was written in the context of using TypeScript since that's my preference.

Why Redux makes sense

  • store.subscribe makes sense in react world with virtual DOM and smart diffing.

Why I like Redux

  • All components are mapped to one state tree.
  • The concept of container/presentation components and immutability are useful.

How to create a node library with scala.js

Assumes you have scala, sbt and IntelliJ installed with scala plugin

  1. Create new Scala > SBT project. Name it tutorial-lib.
  2. Add line to project/plugins.sbt:
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.14")
  1. Add lines to built.sbt:
View classes.ts
class A {
v1: string
v2: number
constructor() {
this.v1 = `Test ${this.v2}`
class B extends A {
View ONE.ts
import { TWO } from './constants'
export const ONE = TWO - 1 // i.e. this evaluates undefined - 1
View index.html
<!DOCTYPE html>
<meta charset="utf-8">
.country {
fill: #C0D9AF;
stroke: #fff;
stroke-width: 1px;
stroke-linejoin: round;
View generators.js
Array.prototype.toIterator = function*() {
for (var i = 0, l = this.length; i < l; i++) {
yield this[i]
} = function*(lambda) {
for (var value of this) {
yield lambda(value)

The way of the substack

With over 200 modules in npm, and many such as browserify, dnode, optimist, etc. relied upon day-to-day by developers all around the world, substack is a pretty damn productive guy.

Plus, he's got an awesome philosophy on programming to boot (yes, there is a programming philosophy! ... no comprende? Let me explain later).

BTW, how do I know this? I got to talk to him at campjs as he wrote & published a module (lexical-scope to be exact). He was super friendly and shared alot of his thoughts on many topics.

All in all, it was really cool to meet someone that's completely congruent with what he says & lives out as a programmer. It almost felt Bret Victor-like.


Oz Big Data (Feb 2013) Meetup

Hadoop is based on MapReduce algorithm.


  • MapReduce is a method of parallelising data processing on several machines.
  • Map = take input and produce key value pairs
  • Reduce = aggregate values with the same key
  • Example is counting words across many documents.