Skip to content

Instantly share code, notes, and snippets.

@JacksonGariety
JacksonGariety / gist:05004b669cfd699c2c2b
Created January 16, 2015 01:39
kill link click-throughs for Backbone
// Kill link click-throughs
$(document).on('click', 'a:not([data-bypass])', function (event) {
if (history.pushState && this.host === window.location.host) {
event.preventDefault()
event.stopPropagation()
App.getInstance().router.navigate(this.pathname, true)
$.reset(this)
}
})

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.

You're now chatting with a random stranger. Say hi!
You both like horny, and nudes.
You: f
Stranger: m
You: f
Stranger: 18
You: 17
You: f
Stranger: What are you up to
You: f
You're now chatting with a random stranger. Say hi!
You both like horny.
You: f
Stranger: M
Stranger: Age?
You: 17
Stranger: 19. Horny?
You: yes
Stranger: Me to. Role play?
You: sure
You're now chatting with a random stranger. Say hi!
You both like kissing.
Stranger: heyy
You: Hi. This Jackson, I got a new number. But I'm calling cause I wanna talk to you, hear me out?
Stranger: ok
You: I know we haven't spoken in a while
You: But I really think we just got off on the wrong foot.
You: It was bad timing, and I was super out of it.
You: So I think you should give it one last shot.
You: You should come over.
You're now chatting with a random stranger. Say hi!
You both like books.
You: hi
Stranger: Hi
You: why are you here?
Stranger: why are you here?
You: why are you answering my questions with questions?
Stranger: why are you answering my questions with questions? hmmmm?
You: asl?
Stranger: stop
Stranger: F
You: m
Stranger: age?
You: 18
You: you?
Stranger: 18 here also!!
Stranger: Hey, I'm Alley :)
You: Jackson
Stranger: Nice to meet you!!
You: you as well
You're now chatting with a random stranger. Say hi!
You both like books.
Stranger: hi
You: hi
Stranger: im Alex
You: prove yourself, Alex
Stranger: and how would i do that
You: you've already failed.
You have disconnected.
Stranger: I thought I had everybody on my side
Stranger: then I blew it all sky high
You: hmmm...
You: family guy?
Stranger: nope
Stranger: cause that sit SUCKS
You: spongebob
You: that's it
Stranger: yep
You: ripped pants
You're now chatting with a random stranger. Say hi!
You: hi
Stranger: Hi
You: why are you here
Stranger: Cuz I'm horny
Stranger: And I'm bored
You: and what's the likelihood you'll be able to get off you think?
You: have you had success?
Stranger: And a bit drink
Stranger: Not likely at all