This is not intended to be comprehensive or authoritative, just free online resources I've found valuable while learning more about Erlang.
| My thoughts on writing tiny reusable modules that each do just one | |
| thing. These notes were adapted from an email I recently sent. | |
| *** | |
| If some component is reusable enough to be a module then the | |
| maintenance gains are really worth the overhead of making a new | |
| project with separate tests and docs. Splitting out a reusable | |
| component might take 5 or 10 minutes to set up all the package | |
| overhead but it's much easier to test and document a piece that is |
| require 'thread' | |
| module SonicPi | |
| class Promise | |
| VAL_SEM = Mutex.new | |
| PUSH_SEM = Mutex.new | |
| def initialize | |
| @box = Queue.new |
| function rm () { | |
| local path | |
| for path in "$@"; do | |
| # ignore any arguments | |
| if [[ "$path" = -* ]]; then : | |
| else | |
| local dst=${path##*/} | |
| # append the time if necessary | |
| while [ -e ~/.Trash/"$dst" ]; do | |
| dst="$dst "$(date +%H-%M-%S) |
| Welcome to Scala version 2.9.2 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_25). | |
| Type in expressions to have them evaluated. | |
| Type :help for more information. | |
| scala> import shapeless._, HList._ | |
| import shapeless._ | |
| import HList._ | |
| scala> "foo" :: 124 :: HNil | |
| res0: shapeless.::[java.lang.String,shapeless.::[Int,shapeless.HNil]] = foo :: 124 :: HNil |
| #!/usr/bin/env bash | |
| # fresh-chrome | |
| # | |
| # Use this script on OS X to launch a new instance of Google Chrome | |
| # with its own empty cache, cookies, and user configuration. | |
| # | |
| # The first time you run this script, it will launch a new Google | |
| # Chrome instance with a permanent user-data directory, which you can | |
| # customize below. Perform any initial setup you want to keep on every |
The venerable master Qc Na was walking with his student, Anton. Hoping to prompt the master into a discussion, Anton said "Master, I have heard that objects are a very good thing - is this true?" Qc Na looked pityingly at his student and replied, "Foolish pupil - objects are merely a poor man's closures."
Chastised, Anton took his leave from his master and returned to his cell, intent on studying closures. He carefully read the entire "Lambda: The Ultimate..." series of papers and its cousins, and implemented a small Scheme interpreter with a closure-based object system. He learned much, and
| (def cds (collection)) | |
| ;; interact with database | |
| (go | |
| (>! (:in cds) | |
| {:op :create | |
| :val {:title "Soft Machine Vol. 1" | |
| :artist "Soft Machine" | |
| :year 1969}}) |
| (ns circles.core | |
| (:require [quil.core :as q])) | |
| ; "hello world" for Quil meets http://bit.ly/18luJO2 | |
| (def the-width 808) | |
| (def the-height 500) | |
| (defn random-x-y [] | |
| (list (int (rand the-width)) |
ror, scala, jetty, erlang, thrift, mongrel, comet server, my-sql, memchached, varnish, kestrel(mq), starling, gizzard, cassandra, hadoop, vertica, munin, nagios, awstats