Skip to content

Instantly share code, notes, and snippets.

View revathskumar's full-sized avatar

Revath S Kumar revathskumar

View GitHub Profile

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.

TypeError: object is not a function
at invoke (/home/revath/code/yeoman/yeoman-generator/lib/actions/invoke.js:28:13)
at null.<anonymous> (/home/revath/code/yeoman/yeoman-generator/lib/base.js:445:12)
at /home/revath/code/yeoman/yeoman-generator/node_modules/async/lib/async.js:610:21
at /home/revath/code/yeoman/yeoman-generator/node_modules/async/lib/async.js:249:17
at iterate (/home/revath/code/yeoman/yeoman-generator/node_modules/async/lib/async.js:149:13)
at async.eachSeries (/home/revath/code/yeoman/yeoman-generator/node_modules/async/lib/async.js:165:9)
at _asyncMap (/home/revath/code/yeoman/yeoman-generator/node_modules/async/lib/async.js:248:13)
at Object.mapSeries (/home/revath/code/yeoman/yeoman-generator/node_modules/async/lib/async.js:231:23)
at Object.async.series (/home/revath/code/yeoman/yeoman-generator/node_modules/async/lib/async.js:608:19)
# Helper functions
#
# helper.js.coffee
NameSpace.Helpers =
a: () ->
console.log 'a'
b: () ->
console.log 'b'
@revathskumar
revathskumar / error.txt
Created June 24, 2014 18:14
npm error log
0 info it worked if it ends with ok
1 verbose cli [ 'node', '/home/revath/.nvm/v0.10.12/bin/npm', 'publish' ]
2 info using npm@1.4.4
3 info using node@v0.10.12
4 verbose publish [ '.' ]
5 verbose cache add [ '.', null ]
6 verbose cache add name=undefined spec="." args=[".",null]
7 verbose parsed url { protocol: null,
7 verbose parsed url slashes: null,
7 verbose parsed url auth: null,

Here is the warning I am receiving, while I use js-api and also without it.

It isn't possible to write into a document from an asynchronously-loaded external script unless it is explicitly opened.

<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Try on React.js" />
<script src="//fb.me/react-0.9.0.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<div id="hello"></div>
d = document
class Wrapper
constructor: (options) ->
@el = options.el
@el.querySelector('.add-item').addEventListener 'click', @add
add: (item) =>
item = new Item({el: d.createElement('li')}) unless item.el
@el.querySelector('.items').appendChild(item.el)
# Makefile.in generated by automake 1.11.3 from Makefile.am.
# Makefile. Generated from Makefile.in by configure.
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
# Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.

why ./task.js?

One word: task automation. It's basically zero effort and you can use the ./task.js package manager to handle any repetitive tasks. You can use ./task.js to automate everything with minimum effort.

./task.js provides the structure, order, and authority that you as a developer so desperately crave. ./task.js will also take responsibility for your actions if you need it to. It's what everybody is using now. ./task.js is the new hotness. It's all about ./task.js now, just like that.

This is compared to npm run/bash scripts, which are:

@revathskumar
revathskumar / bind.js
Last active December 23, 2015 23:29
extend/Inheritance and bind method created by CS
__bind = function(fn, me){
return function(){
return fn.apply(me, arguments);
};
}