Skip to content

Instantly share code, notes, and snippets.

let MyCar = Ember.Object.extend(Ember.Evented, {
turnLightsOn: function() {
this.set('lightsOn', true);
}.on('engineStart'),
turnLigthsOff: function() {
this.set('lightsOn', false);
}.on('engineStop'),
@vire
vire / introrx.md
Last active August 29, 2015 14:23 — forked from staltz/introrx.md

The introduction to Reactive Programming you've been missing

(by @andrestaltz)

So you're curious in learning this new thing called Reactive Programming, particularly its variant comprising of Rx, Bacon.js, RAC, and others.

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.

// source http://codepen.io/yamalight/pen/596767b069e6bc68a95d6d68a2d3979c?editors=001 on RxGitter
const addStream = new Rx.Subject();
const deleteStream = new Rx.Subject();
const modifyStream = new Rx.Subject();
// setup state
const stateStream = Rx.Observable.merge(
addStream.map(v => state => state.concat(v)),
deleteStream.map(v => state => state.filter(x => x.id !== v.id)),
[
[:app "cmd-t" :workspace.show]
[:app "cmd-shift-f" :searcher.show]
[:app "cmd-shift-k" :clear-console]
[:app "cmd-shift-s" :save-all]
[:app "cmd-ctrl-f" :window.fullscreen]
[:app "cmd-k" :toggle-console]
[:app "tab" :focus-last-editor]
[:workspace.focused "enter" :lt.plugins.workspace-nav/open-selection]
// @author Markus Werle @daixtrose
// snippet based on RxJS5+WebSockets discussion in https://gitter.im/Reactive-Extensions/RxJS room
import * as io from 'socket.io-client';
export class SocketService {
public url : string;
private _receivedMessagesRelay: Subject<{}>;
public receivedMessages: Observable<{}>;

Reviewer's checklist - How to boost your code review skills

Purpose of my lightning talk is to present insights I've reached as a reviewer/ reviewee in the last couple of months.

I will answer these questions:

  • What makes a good code review good?
  • How to build guidelines? Dos and Don'ts.
  • How to educate dev/team members about the code review process?
{
"agent": {
"active": true|false,
},
"recipes": {
"-KMYW_ER79aPDAe3mJuY": {...},
"-KMYW_ER79aPDAe1234Y": {...},
"-KMYW_DGADaPDAe3mJuZ": {...}
}
}
[
{
"lat": 50.076191,
"lng": 14.514925,
"minutes": 15
},
{
"lat": 50.068435,
"lng": 14.507169,
"minutes": 49

Keybase proof

I hereby claim:

  • I am vire on github.
  • I am vire (https://keybase.io/vire) on keybase.
  • I have a public key whose fingerprint is 5EDA 5161 27AF 15DE 2CFC CB07 A69B 3F60 DD22 97D1

To claim this, I am signing this object:

@vire
vire / .flowconfig
Created March 9, 2017 14:44 — forked from MoOx/.flowconfig
flow config webpack adjustements to avoid the "Required module not found" for png, css, svg etcc
# ...
[options]
# webpack loaders
module.name_mapper='.*\.css$' -> '<PROJECT_ROOT>/flow/stub/css-modules.js'
module.name_mapper='.*\.\(svg\|png\|jpg\|gif\)$' -> '<PROJECT_ROOT>/flow/stub/url-loader.js'