Skip to content

Instantly share code, notes, and snippets.

View lambder's full-sized avatar

Lambder lambder

View GitHub Profile
@lambder
lambder / js-error-logging-services.md
Created January 29, 2016 10:27 — forked from cheeaun/js-error-logging-services.md
JavaScript error logging services
@lambder
lambder / gist:d71eb91dcf0d2a2ceb15
Created January 12, 2016 15:42 — forked from city41/gist:aab464ae6c112acecfe1
ClojureScript secretary client side navigation without hashes

This is the example that comes with the reagent template converted to use HTML5 based history. This means there are no # in the urls.

I just got this working, so there might be better approaches

The changes are

  • use goog.history.Html5history instead of goog.History
  • listen to clicks on the page, extract the path from them, and push them onto the history
  • listen to history changes, and have secretary do its thing in response
@lambder
lambder / memo.md
Created December 9, 2015 15:10 — forked from yokolet/memo.md
Datomic Pro with PostgreSQL setup

2015-01-29 Unofficial Relay FAQ

Compilation of questions and answers about Relay from React.js Conf.

Disclaimer: I work on Relay at Facebook. Relay is a complex system on which we're iterating aggressively. I'll do my best here to provide accurate, useful answers, but the details are subject to change. I may also be wrong. Feedback and additional questions are welcome.

What is Relay?

Relay is a new framework from Facebook that provides data-fetching functionality for React applications. It was announced at React.js Conf (January 2015).

# Transforming the vanilla recursive fib into the iterative DP version
# through a series of mechanical steps.
#
# For more on converting recursive algorithms into iterative ones, see:
# http://blog.moertel.com/posts/2013-05-11-recursive-to-iterative.html
# original function
def fib(n):

EuroClojure 2014, Krakow

Fergal Byrne, Clortex: Machine Intelligence based on Jeff Hawkins’ HTM Theory

  • @fergbyrne
  • HTM = Hierarchical Temporal Memory
  • Slides

big data

  • big data is like teenage sex
    • noone knows how to do it
    • everyone thinks everyone else is doing it
/**
* Adapted from https://github.com/Khan/react-components/blob/master/js/timeout-transition-group.jsx
*/
var React = require('react/addons');
var ReactTransitionGroup = React.addons.TransitionGroup;
var Velocity = require('velocity-animate');
var transitions = {
// Forcefeeding: property order = [after, before]
@lambder
lambder / introrx.md
Last active August 29, 2015 14:08 — 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 (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.

// ngmin can handle this fine; if not using ngmin, then
// we'd do ['$provide', function($provide) { ... }]
app.config(function($provide) {
// however, ngmin does not know how to preserve the injected dependencies here!
$provide.decorator('SomeFactory', function($delegate, $timeout) {
});
});
@lambder
lambder / app.js
Last active August 29, 2015 14:06 — forked from ilsenem/app.js
// Example
// app.js
document.addEventListener("DOMContentLoaded", function (e) {
m.route.mode = "hash";
m.route(document.getElementById("application"), "/", {
"/": m.resolve("pages.home"),
"/findus": m.resolve("pages.findus")
});
});