Skip to content

Instantly share code, notes, and snippets.

View ngbinh's full-sized avatar

Binh Nguyen ngbinh

  • Anduin Transactions Inc
View GitHub Profile
@ngbinh
ngbinh / gist:f8c4897578eeee9c1ce9
Created April 22, 2015 18:55
`deisclt journal controller` after getting 502
ore@ip-172-31-27-128 ~ $ deisctl journal controller
-- Logs begin at Fri 2015-03-27 11:53:17 UTC. --
Apr 22 18:53:20 ip-172-31-7-103.ec2.internal sh[6958]: 2015-04-22T18:53:18Z 797b456cfb34 confd[91]: ERROR template: confd_settings.py:21:58: executing "confd_settings.py" at <getv "/deis/registry...>: error calling getv: key does not exist
Apr 22 18:53:20 ip-172-31-7-103.ec2.internal sh[6958]: 2015-04-22T18:53:18Z 797b456cfb34 confd[91]: ERROR template: confd_settings.py:21:58: executing "confd_settings.py" at <getv "/deis/registry...>: error calling getv: key does not exist
Apr 22 18:53:20 ip-172-31-7-103.ec2.internal sh[6958]: 2015-04-22T18:53:18Z 797b456cfb34 confd[91]: ERROR template: confd_settings.py:21:58: executing "confd_settings.py" at <getv "/deis/registry...>: error calling getv: key does not exist
Apr 22 18:53:20 ip-172-31-7-103.ec2.internal sh[6958]: 2015-04-22T18:53:18Z 797b456cfb34 confd[91]: ERROR template: confd_settings.py:21:58: executing "confd_settings.py" at <getv "/deis/registry...>: er
@ngbinh
ngbinh / Model.scala
Last active August 29, 2015 14:19
Model ADT
sealed trait Id[T <: Id[T]]
trait Mid[T <: Mid[T]] extends Id[Mid[T]]
trait Sid[T <: Mid[T]] extends Id[Sid[T]]
case class AMid() extends Mid[AMid]
case class CSid() extends Sid[AMid]
class ApiController {
protected def getConfig() {
getGrailsApplication().config
}
protected def jsonData(data = null, otherData = null) {
([data: data] + (otherData ?: [:])) as JSON
}
protected def renderUnacceptable() {
@ngbinh
ngbinh / designer.html
Created September 16, 2014 17:35
designer
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-menu/core-submenu.html">
<polymer-element name="my-element">
@ngbinh
ngbinh / designer.html
Last active August 29, 2015 14:06
designer
<link rel="import" href="../topeka-elements/avatars.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../topeka-elements/topeka-resources.html">
<link rel="import" href="../topeka-elements/topeka-profile.html">
<link rel="import" href="../paper-toast/paper-toast.html">
<link rel="import" href="../paper-input/paper-input.html">
<link rel="import" href="../paper-tabs/paper-tabs.html">
<link rel="import" href="../paper-tabs/paper-tab.html">
<link rel="import" href="../paper-progress/paper-progress.html">
<link rel="import" href="../core-scaffold/core-scaffold.html">
@ngbinh
ngbinh / designer.html
Last active August 29, 2015 14:06
designer
<link rel="import" href="../topeka-elements/category-icons.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../core-icons/av-icons.html">
<link rel="import" href="../paper-fab/paper-fab.html">
<link rel="import" href="../google-map/google-map.html">
<link rel="import" href="../paper-slider/paper-slider.html">
<link rel="import" href="../paper-tabs/paper-tabs.html">
<link rel="import" href="../paper-tabs/paper-tab.html">
<link rel="import" href="../paper-progress/paper-progress.html">

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.