Skip to content

Instantly share code, notes, and snippets.

@CarterTsai
CarterTsai / box-shadow-example.markdown
Created March 28, 2014 15:37
A Pen by CarterTsai.
@CarterTsai
CarterTsai / airplain-canvas.markdown
Created June 24, 2014 06:14
A Pen by CarterTsai.

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.

@CarterTsai
CarterTsai / cache
Created July 20, 2014 13:24
Simulate azure cache and Add expired time function
var CACHE = {};
var cache = function() {
var self = this;
self.memory = {};
};
cache.put = function(key, data , cb) {
var self = this;
self.memory = {key:data};
@CarterTsai
CarterTsai / async-serial-example
Created July 22, 2014 06:57
async serial example
var async = require('async');
function delayRun(data) {
setTimeout(function(){
console.log("run" + data);
}, data);
}
async.series([delayRun(3000),delayRun(1000),delayRun(2000)])
@CarterTsai
CarterTsai / javascript_mapTable_example
Created July 23, 2014 00:11
MapTable for check data is uniqe
var mapTable = {}
// insert key
mapTable["key1"] = '1'
// check key1 exits
if(mapTable.hasOwnProperty("key1")){
console.log('The key1 exits');
}
@CarterTsai
CarterTsai / doraemon.markdown
Last active August 29, 2015 14:06
A Pen by CarterTsai.