Skip to content

Instantly share code, notes, and snippets.

View markthethomas's full-sized avatar

Mark Thomas markthethomas

View GitHub Profile

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.

@markthethomas
markthethomas / keybase.md
Created August 25, 2014 23:24
Keybase.md

Keybase proof

I hereby claim:

  • I am markthethomas on github.
  • I am markthomas (https://keybase.io/markthomas) on keybase.
  • I have a public key whose fingerprint is 1320 1145 D2B8 3FA3 C0B6 576F 008D AAF5 7667 40DC

To claim this, I am signing this object:

@markthethomas
markthethomas / jquery.spin.js
Created July 10, 2014 19:01
jquery.spin.js modification
//lines 100-113 of jquery.spin.js
lines: 13, // The number of lines to draw
length: 0, // The length of each line
width: 8, // The line thickness
radius: 30, // The radius of the inner circle
corners: 1, // Corner roundness (0..1)
rotate: 34, // The rotation offset
direction: 1, // 1: clockwise, -1: counterclockwise
color: '#68d274', // #rgb or #rrggbb or array of colors
speed: 0.8, // Rounds per second
@markthethomas
markthethomas / gruntfile.js
Created June 27, 2014 17:48
Quick grunt-spritesmith config
//..........
sprite: {
all: {
src: 'app/images/FILE_PATH_HERE/*.png',
destImg: 'app/images/spritesheet.png',
destCSS: 'app/styles/_sprites.scss',
'padding': 5,
'cssFormat': 'css',
// OPTIONAL: Map variable of each sprite
@markthethomas
markthethomas / index.html
Created June 16, 2014 17:26
Re-center google map on window resize
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<style type="text/css">
html {
height: 100%
}
body {
@markthethomas
markthethomas / gist:6b114f5fd7d55d29eca3
Created May 31, 2014 19:28
Roots gruntfile with imagemin and autoprefixer
'use strict';
module.exports = function(grunt) {
grunt.initConfig({
jshint: {
options: {
jshintrc: '.jshintrc'
},
all: [
'Gruntfile.js',