Photo by Philipp Katzenberger on Unsplash

Since all evergreen browsers support dynamic import, it’s appears convenient to load some scripts directly from GitHub. But GitHub is not a content delivery network (CDN). It delivers raw files always with the wrong content-type header (its always «text/plain» instead of «text/css» or «application/javascript») and it enforces strict rate limits.

Thankfully, there are some CDN’s serving directly from GitHub:

raw.githack.com

GitHack serves raw files directly from GitHub source code with proper content-type headers.

To get the CDN urls, copy the raw url of the file you want to import into your script. …


Photo by NASA on Unsplash

Currently the bitcoin network consumes more energy than the Netherlands. In other words, if the bitcoin network were a country, it would be the 33th largest in respect to energy consumption.

If we break it down per transaction: One bitcoin transaction uses the same amount of energy, as an U. S. household in 40 days or the equivalent of 800'000 VISA transactions.

But why?

In simple words, bitcoin is a decentralised blockchain. The blocks contain the bitcoin transactions (for a deeper dive in how Bitcoin works, look at my previous article). Once a block is added to the blockchain, it can’t be…


Bitcoin is a cryptocurrency. Bitcoins do not ‘exist’ per se as do gold or real coins. They only exist as transactions on a public ledger, the blockchain. Owning bitcoins means to have access to a cryptographic key pair:

  • a public key to which a previous transaction has sent some bitcoins. This is called a bitcoin address.
  • the corresponding private key which can be used to initiate bitcoin transactions.

The bitcoin address is like an IBAN in the bitcoin network where you can send bitcoins from and receive bitcoins to. The balances of all bitcoin addresses in the bitcoin network are…


Photo by CHUTTERSNAP on Unsplash

ESBuild is the cool new kid in the TypeScript family! It is a JavaScript bundler written in Go which supports blazing fast ESNext & TypeScript transpilation and minification.

Using ESBuild to transpile Typescript

The esbuild-loader is a drop in replacement for ts-loader. After installing esbuild-loader with

npm i -D esbuild-loader

update the Webpack config to replace the ts-loader with esbuild-loader:

module.exports = {
module: {
rules: [
{
test: /\.ts$/,
- loader: 'ts-loader',
- options: {
- transpileOnly: true
- }
+ loader: 'esbuild-loader',
+ options: {
+ loader: 'ts', // also 'tsx' is supported
+ target: 'es2016'
+ }
},
...
],
},
}

Add type checking

Lukas Gamper

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