(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.
| (defn v-> [s v] | |
| "pushes value onto stack, if possible, returns new head/tail" | |
| (let [p (promise)] | |
| (if (deliver s (cons v (list p))) | |
| p))) | |
| (defn v<- [s] | |
| "returns lazy sequence of actual values, without head/tail" | |
| (when (realized? s) | |
| (cons (first @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.
Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.
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.
Relay is a new framework from Facebook that provides data-fetching functionality for React applications. It was announced at React.js Conf (January 2015).
| import os | |
| import opengl | |
| import glfw/wrapper as glfw | |
| var | |
| win: GLFWwindow | |
| vaoID: GLuint | |
| vboID: GLuint | |
| cboID: GLuint | |
| vertexShaderID: GLuint |
| #!/bin/bash | |
| # Automatically configure a VM download Coursera courses. | |
| # This script works as a user data file for use with a cloud VM. | |
| # This script will resume downloading if the VM is restarted. | |
| # This script works with Debian jessie (or possibly Ubuntu with systemd). | |
| # You must enroll in each course and accept the Honor of Code of each course | |
| # before you can download them. |
| -- Create the raw events table | |
| CREATE TABLE page_views ( | |
| site_id int, | |
| path text, | |
| client_ip inet, | |
| view_time timestamptz default now(), | |
| view_id bigserial | |
| ); | |
| -- Allow fast lookups of ranges of sequence IDs |
| BEGIN; | |
| -- note: the downside of a DOMAIN type in pg is that the type cannot be modified if it's used in | |
| -- a composite-type column as yet (i hope we don't do that) | |
| -- pgTAP is a suite of test functions to test SQL scripts on PostgreSQL - see https://pgtap.org/ | |
| CREATE EXTENSION IF NOT EXISTS pgtap; | |
| -- we will have 4 pgTAP tests | |
| SELECT plan(4); |
I've been deceiving you all. I had you believe that Svelte was a UI framework — unlike React and Vue etc, because it shifts work out of the client and into the compiler, but a framework nonetheless.
But that's not exactly accurate. In my defense, I didn't realise it myself until very recently. But with Svelte 3 around the corner, it's time to come clean about what Svelte really is.
Svelte is a language.
Specifically, Svelte is an attempt to answer a question that many people have asked, and a few have answered: what would it look like if we had a language for describing reactive user interfaces?
A few projects that have answered this question: