Skip to content

Instantly share code, notes, and snippets.

Avatar

Dustin Getz dustingetz

View GitHub Profile
View gist:8837731

I like LYAH as a reference and cheat-sheet but I found it a little slow for learning Haskell.

Here's my recommended order for just learning Haskell:

http://yannesposito.com/Scratch/en/blog/Haskell-the-Hard-Way/ 80% completion here is fine if you feel your attention waning, the next thing will address hammering in things like functors and monads via typeclasses.

https://github.com/NICTA/course/ this will hammer in the lessons in a very direct form by forcing you to confront the challenges and lessons learned by the creators and community of Haskell itself. Doing the exercises here is critical for being fluent.

Real World Haskell is available online. I recommend it as a reference only.

View gist:10940534
// Not all of the pipeline is async, but some of it is, so even the non-async functions
// get lifted into a promise (a compliant Promises/A+ impl will lift your functions for free)
Q.delay(100)
.then(function (_) { return { a: 1 }})
.then(function (acc) { return _.extend(acc, { b: 2 }); })
.then(function (acc) { return _.extend(acc, { a: acc.a + 1 }); })
.then(_.bind(this.setState, this))
.done();
View gist:2fae2696b298a05564de
/** @jsx React.DOM */
define([
'underscore', 'react', 'wingspan-forms', 'wingspan-cursor'
], function (_, React, Forms, Cursor) {
'use strict';
var FormField = Forms.FormField;
var KendoText = Forms.KendoText;
var KendoComboBox = Forms.KendoComboBox;
var AutoControl = Forms.AutoControl;
View gist:04897a879465d5b11225
define([
'underscore.mixed', 'react', 'wingspan-forms'
], function (_, React, Forms) {
'use strict';
var DateSlider = React.createClass({
displayName: 'DateSlider',
getDefaultProps: _.always({
cursor: undefined
View gist:d3d6490a3af2c2b10d58
define([
'underscore', 'react', 'jquery', 'kendo', 'underscore.string'
], function (_, React, $, kendo, str) {
'use strict';
var KendoPanelBar = React.createClass({
getDefaultProps: function () {
return {
panels: undefined,
@dustingetz
dustingetz / gist:018828c0754e0e73f8c8
Created Jul 7, 2014
Dismissible Grid - Dustin's version
View gist:018828c0754e0e73f8c8
define([
'underscore.mixed', 'react', 'wingspan-forms'
], function (_, React, Forms) {
'use strict';
var SelectedRecipientsGrid = React.createClass({
getDefaultProps: function () {
return {
dataSource: undefined, // the datasource as list of records
@dustingetz
dustingetz / gist:ee926a14a36137a34b2c
Created Jul 7, 2014
Kendo Grid Picker using native Kendo selection state
View gist:ee926a14a36137a34b2c
define([
'underscore.mixed', 'react', 'jquery', 'wingspan-forms'
], function (_, React, $, Forms) {
'use strict';
var PatientPicker = React.createClass({
displayName: 'PatientPicker',
getDefaultProps: function () {
return {
View gist:240ffacda5edf5802a00
// In lieu of unit tests:
var c1 = window.c1 = Cursor.build(window.App);
var c2 = window.c2 = Cursor.build(window.App);
console.assert(c1.value === c2.value);
console.assert(c1.onChange === c2.onChange);
console.assert(c1 === c2);
var c10 = c1.refine('very', 'deeply', 'nested', 'counts', '0');
var c20 = c2.refine('very', 'deeply', 'nested', 'counts', '0');
console.assert(c10.value === c20.value);
View gist:9365786981b891af08bf
/**
* Turns an array of promises into a promise for an array. If any of
* the promises gets rejected, the whole array is rejected immediately.
* @param {Array*} an array (or promise for an array) of values (or
* promises for values)
* @returns a promise for an array of the corresponding values
*/
// By Mark Miller
// http://wiki.ecmascript.org/doku.php?id=strawman:concurrency&rev=1308776521#allfulfilled
Q.all = all;
@dustingetz
dustingetz / gist:1490f9ecd2903203cd99
Created Oct 1, 2014
proper separation of concerns
View gist:1490f9ecd2903203cd99
(ns quiescent-json-editor.core
(:require [cljs.core.async :as a]
[quiescent :as q :include-macros true]
[quiescent.dom :as d])
(:require-macros [cljs.core.async.macros :as am]))
(q/defcomponent App [state dispatcher]
(d/div {}
(d/pre {} (.stringify js/JSON state))
You can’t perform that action at this time.