(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
# install git | |
sudo apt-get install g++ curl libssl-dev apache2-utils | |
sudo apt-get install git-core | |
# download the Node source, compile and install it | |
git clone https://github.com/joyent/node.git | |
cd node | |
./configure | |
make | |
sudo make install | |
# install the Node package manager for later use |
var oldSync = Backbone.sync; | |
Backbone.sync = function(method, model, options){ | |
options.beforeSend = function(xhr){ | |
xhr.setRequestHeader('X-CSRFToken', CSRF_TOKEN); | |
}; | |
return oldSync(method, model, options); | |
}; |
// Media Queries in Sass 3.2 | |
// | |
// These mixins make media queries a breeze with Sass. | |
// The media queries from mobile up until desktop all | |
// trigger at different points along the way | |
// | |
// And important point to remember is that and width | |
// over the portrait width is considered to be part of the | |
// landscape width. This allows us to capture widths of devices | |
// that might not fit the dimensions exactly. This means the break |
(ns lisp-ch1) | |
(def self-evaluating? | |
(some-fn number? string? char? | |
true? false? vector?)) | |
(defn -atom? [s] | |
(or (self-evaluating? s) | |
(symbol? s))) |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
// ES7, async/await | |
function sleep(ms = 0) { | |
return new Promise(r => setTimeout(r, ms)); | |
} | |
(async () => { | |
console.log('a'); | |
await sleep(1000); | |
console.log('b'); | |
})() |
/*eslint-env es6 */ | |
// Inspired by the paper "A tutorial on the universality and | |
// expressiveness of fold" by Graham Hutton (available at | |
// http://www.cs.nott.ac.uk/~gmh/fold.pdf), implementing some generic | |
// list handling functions in JavaScript in terms of `fold`. | |
// Personally I had an enlightnening moment when I realised the | |
// beautiful interplay of cons lists and foldr during the FP101x | |
// Haskell course. JavaScript's syntax doesn't make this very apparent |
Picking the right architecture = Picking the right battles + Managing trade-offs
I recently had several days of extremely frustrating experiences with service workers. Here are a few things I've since learned which would have made my life much easier but which isn't particularly obvious from most of the blog posts and videos I've seen.
I'll add to this list over time – suggested additions welcome in the comments or via twitter.com/rich_harris.
Chrome 51 has some pretty wild behaviour related to console.log
in service workers. Canary doesn't, and it has a load of really good service worker related stuff in devtools.