This is a summary of the "Learn You A Haskell" online book under http://learnyouahaskell.com/chapters.
- Haskell is a functional programming language.
// options | |
String imagePath = "img/desandro-avatar.jpg"; | |
float res = 10; // resolution, dot density | |
float zoom = 3.0; // proportion to zoom image | |
boolean isAdditive = true; // true = RGB, false = CMY | |
float offsetAngle = 1; // affects dot pattern | |
/* | |
0 = no patter | |
0.05 = slight offset | |
1 = slight offset |
This is a summary of the "Learn You A Haskell" online book under http://learnyouahaskell.com/chapters.
In this gist I would like to describe an idea for GraphQL subscriptions. It was inspired by conversations about subscriptions in the GraphQL slack channel and different GH issues, like #89 and #411.
At the moment GraphQL allows 2 types of queries:
query
mutation
Reference implementation also adds the third type: subscription
. It does not have any semantics yet, so here I would like to propose one possible semantics interpretation and the reasoning behind it.
A complete list of RxJS 5 operators with easy to understand explanations and runnable examples.
// Turns out this was not too difficult. | |
// By using the event loop as a global mail box ordering is even guaranteed for messages between only two actors. | |
// TODO would like to try and put one actor in a web worker to get some real parallism | |
// TODO would like to handle errors and have the concept of a deceased actor while a reference to an actor still exists. Probably involves creating an actor system like in Scala. Eurgh. | |
var actor = { | |
send: function(message) { | |
var self = this; | |
console.log("sending to:", self); | |
setTimeout(function(){ |
[class*='col-'] { | |
//Aligns the columns next to each other | |
width: 100%; | |
float:left; | |
min-height: 1px; | |
} | |
// an extend only class for clearfixing | |
%clearfix { | |
*zoom: 1; | |
&:before, |
This is a tiny webpack loader that invokes a given module with another as an argument.
What's that useful for? Dependency Injection! Maybe this is how we can solve the VDOM fragmentation issue.
Here's a library-agnostic VDOM component. Notice that it doesn't import react/preact/inferno/whatever - instead, it takes the VDOM library as an argument.
{-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
module Language.HigherRank.Main | |
( Expr(..) | |
, EVar(..) | |
, Type(..) | |
, TVar(..) | |
, TEVar(..) | |
, runInfer | |
) where |
How do you send information between clients and servers? What format should that information be in? What happens when the server changes the format, but the client has not been updated yet? What happens when the server changes the format, but the database cannot be updated?
These are difficult questions. It is not just about picking a format, but rather picking a format that can evolve as your application evolves.
By now there are many approaches to communicating between client and server. These approaches tend to be known within specific companies and language communities, but the techniques do not cross borders. I will outline JSON, ProtoBuf, and GraphQL here so we can learn from them all.
let cache = new Map(); | |
let pending = new Map(); | |
function fetchTextSync(url) { | |
if (cache.has(url)) { | |
return cache.get(url); | |
} | |
if (pending.has(url)) { | |
throw pending.get(url); | |
} |