Skip to content

Instantly share code, notes, and snippets.

TLDR: RSVP at https://www.meetup.com/Docker-London/events/234774339/, make sure you have a Docker Hub account, and bring your laptop fully charged with Docker set-up. See below for some further instructions and details.

Create a Docker Hub account here at https://hub.docker.com. You will need a Docker Hub account to access the course materials.

Set-up Docker on your laptop (you will need to bring your computer): Linux users: we need you to install Docker Engine and Docker compose. Make sure you have Docker compose version 1.6 or higher by running docker-compose version from the command prompt. Mac users: install Docker for Mac or if you have an older Mac, Docker Toolbox.

Windows users: if you have Windows 10 pro install Docker for Windows, otherwise install Docker Toolbox. If you want to try the new Windows containers, go through the setup steps in the Windows Container lab. It is essential to run this command in Powershell before coming to the event:

@mickeypash
mickeypash / game-of-life.py
Created July 10, 2016 10:20
Conway's Really Simple Game of Life based on ("Stop Writing Classes" PyCon 2012)[https://www.youtube.com/watch?v=o9pEzgHorH0]
import itertools
# Conway's Really Simple Game of Life based on "Stop Writing Classes" PyCon 2012
def neighbors(point):
x,y = point
yield x + 1, y
yield x - 1, y
yield x, y + 1
yield x, y - 1
@nicokosi
nicokosi / notes-on-funprog2.md
Last active September 21, 2017 23:06
Notes on Coursera course "Functional Program Design in Scala" (https://www.coursera.org/learn/progfun2)

Week 1

lecture "Recap: Functions and Pattern Matching"

recursive function + case classes + pattern matching: example JSON printer (Scala -> JSON) pattern matching in Scala SDK: PartialFunction is a Trait with def isDefinedAt(x: A): Boolean

lecture "Recap: Collections"

  • Iterable (base class)
    • Seq

10 Scala One Liners to Impress Your Friends

Here are 10 one-liners which show the power of scala programming, impress your friends and woo women; ok, maybe not. However, these one liners are a good set of examples using functional programming and scala syntax you may not be familiar with. I feel there is no better way to learn than to see real examples.

Updated: June 17, 2011 - I'm amazed at the popularity of this post, glad everyone enjoyed it and to see it duplicated across so many languages. I've included some of the suggestions to shorten up some of my scala examples. Some I intentionally left longer as a way for explaining / understanding what the functions were doing, not necessarily to produce the shortest possible code; so I'll include both.

1. Multiple Each Item in a List by 2

The map function takes each element in the list and applies it to the corresponding function. In this example, we take each element and multiply it by 2. This will return a list of equivalent size, compare to o

@kirelagin
kirelagin / Huffman.lhs
Created October 13, 2012 21:44
Very simple implementation of Huffman coding in Haskell
> module Huffman where
> import Control.Arrow
> import Data.List
> import qualified Data.Map as M
> import Data.Function
This typeclass is supposed to make life _a bit_ easier.