Or, how fast is localhost?

iPerf is a command line tool that can be used to measure network throughput.

For example, if endpoint A is sending data to endpoint B, you can use iPerf to determine how many bytes/second endpoint A can send, and how many bytes/second endpoint B can receive.

The rates should be similar due to TCP congestion control, which limits the number of un-acked segments that can be sent. …


Why do cats look like this?

It’s Epigenetics

The answer turns out to be fairly simple. One gene for fur color lives on the X chromosome. Female cat cells have two X chromosomes — one is paternal, one is maternal. However, because of something called random X inactivation, a random X chromosome gets randomly inactivated in each cell. Thus, if the paternal gene for fur color is different than the maternal gene, this random inactivation can lead to the non-uniform color patterns so distinctive of calico and tortoiseshell cats.


The Problem

In general, Firebase focuses on empowering clients (e.g. web clients and mobile clients) with useful libraries and APIs. Unfortunately, this means their support for server-side environments is not as robust. The typical way to use Firebase on a server is via the Admin SDK; however, it doesn’t have feature parity with the client-side APIs. The missing feature we’re concerned with in this post is the lack of server-side Firebase Analytics support. Note that the Firebase team is aware of this problem; check out this Github issue and this Github issue.

Let’s refresh our memories. Here’s how you log an event…


When building a GraphQL server, one of the first decisions you must make is which GraphQL implementation to use. There are three popular options.

  1. GraphQL.js — This is the reference implementation for GraphQL. GraphQL schemas are built by composing objects created from classes such as GraphQLObjectType, GraphQLInterfaceType, and GraphQLEnumType.
  2. TypeGraphQL — This implementation builds upon the reference implementation and adds built-in TypeScript support. It makes it easier to make schemas typesafe. GraphQL schemas are built by creating classes and decorating them and their methods with TypeGraphQL decorators.
  3. GraphQL Nexus — Similarly to TypeGraphQL, this implementation builds upon the reference implementation…


If you’ve tried to use adb forward, you might have noticed that the official documentation is missing a lot of information. adb --help is a lot better:

forward [--no-rebind] LOCAL REMOTE
forward socket connection using:
tcp:<port> (<local> may be "tcp:0" to pick any open port)
localabstract:<unix domain socket name>
localreserved:<unix domain socket name>
localfilesystem:<unix domain socket name>
dev:<character device name>
jdwp:<process pid> (remote only)

If you want even more information, you can check out the source code, specifically SERVICES.TXT. It tells you about the forward command

<host-prefix>:forward:<local>;<remote> Asks the ADB server to forward local connections from <local> to the <remote>…

Confused about the order in which JavaScript promises execute? I was too. Working through some examples and referencing the JavaScript spec helped better my understanding — hopefully it can do the same for you.

Promise States

Before we dive into the examples, let’s review some helpful background knowledge.

A promise can be in one of three mutually exclusive states: fulfilled, rejected, or pending. Here is how spec 26.6 defines these states.

  • A promise p is fulfilled if p.then(f, r) will immediately enqueue a Job to call the function f.
  • A promise p is rejected if p.then(f, …


This is not meant to be a comprehensive overview of ES modules and CommonJS modules — I do not go into depth about what modules are and how they work. Rather, it is meant to highlight the differences between ES modules and CommonJS modules and how you can use them together.

This is part one of a four part series.

  1. The three differences between require and import in JavaScript
  2. Using ES modules using CommonJS modules in Node.js
  3. Using ES modules using CommonJS modules in the browser
  4. Using ES modules using CommonJS modules with webpack

Check out full code examples here…


This is not meant to be a comprehensive overview of ES modules and CommonJS modules — I do not go into depth about what modules are and how they work. Rather, it is meant to highlight the differences between ES modules and CommonJS modules and how you can use them together.

This is part two of a four part series.

  1. The three differences between require and import in Node.js
  2. Using ES modules with CommonJS modules in Node.js
  3. Using ES modules with CommonJS modules in the browser
  4. Using ES modules with CommonJS modules with webpack

Check out full code examples here…


This is not meant to be a comprehensive overview of ES modules and CommonJS modules — I do not go into depth about what modules are and how they work. Rather, it is meant to highlight the differences between ES modules and CommonJS modules and how you can use them together.

This is part two of a four part series.

  1. The three differences between require and import in Node.js
  2. Using ES modules with CommonJS modules in Node.js
  3. Using ES modules with CommonJS modules in the browser
  4. Using ES modules with CommonJS modules with webpack

Check out full code examples here…


These differences apply to the import statement, not the import expression (see this page for more info on the latter, which can be used to import modules dynamically).

This is part one of a four part series about JavaScript modules.

  1. The three differences between require and import in Node.js
  2. Using ES modules with CommonJS modules in Node.js
  3. Using ES modules with CommonJS modules in the browser
  4. Using ES modules with CommonJS modules with webpack

Check out full code examples here: https://github.com/arcticmatt/javascript_modules/tree/master/import_vs_require.

  1. When using import ... from ..., the module path must be a string literal. …

Matt Lim

Software Engineer. Tweeting @pencilflip. Mediocre boulderer, amateur tennis player, terrible at Avalon. https://www.mattlim.me/

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store