This is an implementation of monads in a way that is pretty for LiveScript(given its amazing syntactic structures). This was originally a comment for LiveScript #426.
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
/* | |
* Photon | |
* http://photon.attasi.com | |
* | |
* Licensed under the MIT license. | |
* Copyright 2012 Tom Giannattasio | |
*/ | |
This is a plain-text version of Bret Victor’s reading list. It was requested by hf on Hacker News.
Highly recommended things!
This is my five-star list. These are my favorite things in all the world.
A few of these works have had an extraordinary effect on my life or way of thinking. They get a sixth star. ★
Proposal | |
-------- | |
The proposal is to add a static ArrayBuffer.transfer(oldBuffer [, newByteLength]). This | |
method returns a new ArrayBuffer whose contents are taken from oldBuffer.[[ArrayBufferData]] | |
and then either truncated or zero-extended to be newByteLength. This operation leaves | |
oldBuffer in a detached state. If newByteLength is undefined, oldBuffer.byteLength is | |
used. | |
var buf1 = new ArrayBuffer(40); |
var when = require('when'); | |
unhandledRejectionsWithSourceMaps(when.Promise); | |
function unhandledRejectionsWithSourceMaps(Promise) { | |
Promise.onPotentiallyUnhandledRejection = function(r) { | |
setTimeout(function() { | |
if(!r.handled) { | |
throw r.value; | |
} |
In my proposed lightning talk for the Reactive Conference, I'll create Conway's Game of Life in ClojureScript, and I'll do it in five minutes. I'll use an interactive programming workflow enabled by Figwheel. Each piece will be added into the running application without reloading the page.
If you want to see a little cellular lifeform spawn out of nothing into an running web browser window, I'd appreciate it if you starred this Gist!
Cheers,
(@teropa)
So basically FlowType doesn't know about CSS Modules, a really handy way of dealing with the plagues of CSS in codebases (global variables and dependency wackiness mainly).
What WebPack allows us to do is "require" CSS files and use their class names:
import styles from "my_styles.css";
import React from "react";
This is a proposal for a lightning talk I would give at the Reactive 2015 conference.
NOTE: If you like it, put a star ⭐ on it—the number of stars decides if it makes the cut!
Redux provides a simple pattern for managing application state. As demonstrated in Dan Abramov's talk following this pattern lets you painlessly implement simple undo and time travel. By keeping a history of actions, and reducing a subset
request = require 'superagent-bluebird-promise' | |
Promise = require 'bluebird' | |
history = require '../history' | |
module.exports = class RelayNetworkLayer | |
constructor: (options = {}) -> | |
@token = options.token | |
@host = options.host | |
sendMutation: (requests) -> |