Skip to content

Instantly share code, notes, and snippets.


Revath S Kumar revathskumar

View GitHub Profile
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
View jsbin.wegew.html
<!DOCTYPE html>
<meta name="description" content="Try on React.js" />
<script src="//"></script>
<meta charset="utf-8">
<title>JS Bin</title>
<div id="hello"></div>

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.

revathskumar / error.txt
Created June 24, 2014 18:14
npm error log
View error.txt
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,
# Helper functions
NameSpace.Helpers =
a: () ->
console.log 'a'
b: () ->
console.log 'b'
View gist:295256bb58da56e5d3be
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)

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.

View gist:d8885a9bce49db28cc35
# SSL self signed localhost for rails start to finish, no red warnings.
# 1) Create your private key (any password will do, we remove it below)
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key
revathskumar /
Created September 18, 2014 05:46
hub get repository
git remote -v | awk -F: {'print $2'} | awk -F. {'print $1'}
View SpecRunner.js
baseUrl: '/backbone-tests/',
paths: {
'jquery' : '/app/libs/jquery',
'underscore' : '/app/libs/underscore',
'backbone' : '/app/libs/backbone',
'mocha' : 'libs/mocha',
'chai' : 'libs/chai',
'chai-jquery' : 'libs/chai-jquery',
'models' : '/app/models'