I'm taking down this post. I just posted this as a side comment to explain a sentence on my latest blog post. This wasn't meant to be #1 on HN to start a huge war on functional programming... The thoughts are not well formed enough to have a huge audience. Sorry for all the people reading this. And please, don't dig through the history...
Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.
This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would
| 100+ different js counter apps... |
This is my take on how to get up and running with NGINX, PHP-FPM, MySQL and phpMyAdmin on OSX Yosemite.
This article is adapted from the original by Jonas Friedmann. Who I just discovered is from Würzburg in Germany. A stonesthrow from where I was born ;)
Make sure you have the latest version of XCode installed. Available from the Mac App Store.
Install the Xcode Command Line Tools:
xcode-select --install
-
brew install gnupg, pinentry-mac(this includes gpg-agent and pinentry) -
Generate a key:
$ gpg --gen-key -
Take the defaults. Whatevs
-
Tell gpg-agent to use pinentry-mac:
$ vim ~/.gnupg/gpg-agent.conf
| const daggy = require('daggy'); | |
| const {foldMap} = require('pointfree-fantasy') | |
| const {concat, toUpper, prop, identity, range, compose} = require('ramda'); | |
| // Contravariant functors usually have this shape F(a -> ConcreteType). | |
| // In other words, some type holding a function which is parametric on its input, but not output. | |
| // They don't always have that shape, but it's a good intuition | |
| // Covariant functors are what we're used to, which are parametric in their output | |
| //================================================================ |
| ;; Credits: | |
| ;; | |
| ;; * ClojureScript | |
| ;; * Reagent https://reagent-project.github.io/ | |
| ;; * Figwheel https://github.com/bhauman/lein-figwheel | |
| ;; * core.async https://clojure.github.io/core.async/ | |
| ;; * Christophe Grand's Life implementation http://clj-me.cgrand.net/2011/08/19/conways-game-of-life/ | |
| (ns life.core | |
| (:require [reagent.core :as r] |
| // How to connect 5 publishers with 5 subscribers | |
| // over TCP using ZeroMQ's XPUB/XSUB proxy. | |
| // sub (connect) | |
| // <-8701-> | |
| // (bind) xpub <---> xsub (bind) | |
| // <-8700-> | |
| // (connect) pub | |
| var zmq = require('zmq'); |
@mafintosh asks: "Does anyone have a good code example of when to use setImmediate instead of nextTick?"
https://twitter.com/mafintosh/status/624590818125352960
The answer is "generally anywhere outside of core".
process.nextTick is barely asynchronous. Flow-wise it is asynchronous, but it will trigger before any other asynchronous events can (timers, io, etc.) and thus can starve the event loop.
In this script I show a starved event loop where I just synchronously block, use nextTick and setImmediate