Exhaustive list of SPDX (Software Package Data Exchange) licenses: https://spdx.org/licenses/
CertSimple just wrote a blog post arguing ES2017's async/await was the best thing to happen with JavaScript. I wholeheartedly agree.
In short, one of the (few?) good things about JavaScript used to be how well it handled asynchronous requests. This was mostly thanks to its Scheme-inherited implementation of functions and closures. That, though, was also one of its worst faults, because it led to the "callback hell", an seemingly unavoidable pattern that made highly asynchronous JS code almost unreadable. Many solutions attempted to solve that, but most failed. Promises almost did it, but failed too. Finally, async/await is here and, combined with Promises, it solves the problem for good. On this post, I'll explain why that is the case and trace a link between promises, async/await, the do-notation and monads.
First, let's illustrate the 3 styles by implementing
-
Install Kafka
cd /opt curl -O http://www.gtlib.gatech.edu/pub/apache/kafka/0.11.0.0/kafka_2.11-0.11.0.0.tgz tar xvzf kafka_2.11-0.11.0.0.tgz ln -s kafka_2.11-0.11.0.0/ kafka
-
Edit
/usr/lib/systemd/system/kafka-zookeeper.service
const path = require('path'); | |
const SOURCE = 'src'; | |
const SOURCE_PATH = path.resolve(SOURCE) + '/'; | |
const removeSourceDirName = path => | |
path.replace(new RegExp(`^${SOURCE}\/?`, 'gi'), ''); | |
CREATE SEQUENCE public.global_id_seq; | |
ALTER SEQUENCE public.global_id_seq OWNER TO postgres; | |
CREATE OR REPLACE FUNCTION public.id_generator() | |
RETURNS bigint | |
LANGUAGE 'plpgsql' | |
AS $BODY$ | |
DECLARE | |
our_epoch bigint := 1314220021721; | |
seq_id bigint; |
import { addMiddleware } from 'graphql-add-middleware'; | |
addMiddleware(schema, traceResolveMiddleware); |
root = true | |
[*] | |
indent_style = space | |
indent_size = 2 | |
charset = utf-8 | |
trim_trailing_whitespace = true | |
insert_final_newline = true | |
end_of_line = lf | |
# editorconfig-tools is unable to ignore longs strings or urls |
# Just place this file in your repo under the .github/workflows folder. | |
# You set all of the secrets in the setting of the repo | |
name: Deploy to Testflight | |
# When a pull request is closed... | |
# This is because this action commits back to the repository | |
# so setting this on a push would cause an infinite loop of commits | |
# unless you pragmatically check the contents of the repo or something |
Here is the best setup (I think so :D) for K-series Keychron keyboards on Linux.
Note: many newer Keychron keyboards use QMK as firmware and most tips here do not apply to them. Maybe the ones related to Bluetooth can be useful, but everything related to Apple's keyboard module (hid_apple
) on Linux, won't work. As far as I know, all QMK-based boards use the hid_generic
module instead. Examples of QMK-based boards are: Q, Q-Pro, V, K-Pro, etc.
Most of these commands have been tested on Ubuntu 20.04 and should also work on most Debian-based distributions. If a command happens not to work for you, take a look in the comment section.
Older Keychron keyboards (those not based on QMK) use the hid_apple
driver on Linux, even in the Windows/Android mode, both in Bluetooth and Wired modes.
// Utility types | |
type Length<T extends any[]> = T extends { length: infer L } ? L : never; | |
type BuildTuple<L extends number, T extends any[] = []> = | |
T extends { length: L } | |
? T | |
: BuildTuple<L, [...T, any]>; | |
type MultiAdd<N extends number, A extends number, I extends number> = | |
I extends 0 |