Skip to content

Instantly share code, notes, and snippets.

The introduction to Reactive Programming you've been missing

(by @andrestaltz)

So you're curious in learning this new thing called (Functional) Reactive Programming (FRP).

Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:

Rx.Observable.prototype.flatMapLatest(selector, [thisArg])

Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.

[global]
time_based
thread
fadvise_hint=0
@Swind
Swind / hello.py
Created August 25, 2013 09:13
Simple Python Plugin
from random import randint
import ucltip
def hello_world_cmd(name):
"""Execute remote performance test.
-n=<str> --name=<str> Hello Name
"""
print "hello world cmd %s" % name
print "Test import random %d" % randint(0, 51)
#include <inttypes.h>
#include <unistd.h>
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <sys/ioctl.h>
#include <scsi/sg.h> /* take care: fetches glibc's /usr/include/scsi/sg.h */
/* This is a simple program executing a SCSI INQUIRY command using the
@Swind
Swind / CreateRepositoryCommand.scala
Created October 2, 2012 15:20
[Scala][Script] Create Add jar to Maven Repository Command
import java.io.File
object CreateRepositoryCommand {
val PATH = """PATH"""
val command = "mvn install:install-file " +
"-Dfile=%s " +
"-DgroupId=%s " +
"-DartifactId=%s " +
"-Dversion=%s " +
@Swind
Swind / gist:3383896
Created August 18, 2012 01:55 — forked from chinghanho/gist:3346205
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@Swind
Swind / Example.scala
Created May 5, 2012 23:00
[Scala][OAuth][JSON] Scala Example
import org.json.{JSONObject, JSONArray}
import java.util.Date
/**Result**
{ "action_list" : [ { "action_id" : 1,
"action_type" : "get-all",
"get_deleted" : true
} ],
"client_version" : 0,
"latest_sync_point" : 1303995807749
@Swind
Swind / FileUtils.scala
Created May 5, 2012 14:57
[Scala][IO] I/O Opertaions
package tw.epubcoverter.util
import java.io.File
import java.io.InputStream
import java.io.OutputStream
object FileUtils {
/**
* ***********************************************
@Swind
Swind / ZipArchive.scala
Created May 5, 2012 09:41
[Scala][Zip] This use apache common compress to unzip a zip file.
package tw.epubcoverter
import java.util.zip.ZipFile
import java.io.FileInputStream
import java.io.FileOutputStream
import scala.collection.JavaConversions._
import java.io.InputStream
import java.io.OutputStream
import java.io.File
import java.util.zip.ZipEntry
@Swind
Swind / unzip.scala
Last active April 22, 2018 08:09
[Unzip in Scala] #Scala #zip
import java.util.zip.ZipFile
import java.io.FileInputStream
import java.io.FileOutputStream
import scala.collection.JavaConversions._
import java.util.zip.ZipEntry
import java.io.InputStream
import java.io.OutputStream
import java.io.File
class ZipArchive {