Skip to content

Instantly share code, notes, and snippets.

joepie91 /
Last active January 12, 2023 22:57
No, your cryptocurrency cannot work

No, your cryptocurrency cannot work

Whenever the topic of Bitcoin's energy usage comes up, there's always a flood of hastily-constructed comments by people claiming that their favourite cryptocurrency isn't like Bitcoin, that their favourite cryptocurrency is energy-efficient and scalable and whatnot.

They're wrong, and are quite possibly trying to scam you. Let's look at why.

What is a cryptocurrency anyway?

There are plenty of intricate and complex articles trying to convince you that cryptocurrencies are the future. They usually heavily use jargon and vague terms, make vague promises, and generally give you a sense that there must be something there, but you always come away from them more confused than you were before.

joepie91 /
Last active February 3, 2023 11:33
ES Modules are terrible, actually

ES Modules are terrible, actually

This post was adapted from an earlier Twitter thread.

It's incredible how many collective developer hours have been wasted on pushing through the turd that is ES Modules (often mistakenly called "ES6 Modules"). Causing a big ecosystem divide and massive tooling support issues, for... well, no reason, really. There are no actual advantages to it. At all.

It looks shiny and new and some libraries use it in their documentation without any explanation, so people assume that it's the new thing that must be used. And then I end up having to explain to them why, unlike CommonJS, it doesn't actually work everywhere yet, and may never do so. For example, you can't import ESM modules from a CommonJS file! (Update: I've released a module that works around this issue.)

And then there's Rollup, which apparently requires ESM to be u

joepie91 /
Last active February 3, 2023 04:23
The One Secret Trick To Becoming A Genius Programmer

The One Secret Trick To Becoming A Genius Programmer

Okay, the title of this post is a bit of a lie. There's no one secret trick to becoming a genius programmer - there are two, and they're more habits than tricks. Nevertheless, these kind of 'secret tricks' seem to resonate with people, so I went for this title anyway.

Every once in a while, a somewhat strange thing happens to me. I'll be helping somebody out on IRC - usually a beginner - answering a number of their questions in rapid succession, about a variety of topics. Then after a while, they call me a "genius" for being able to answer everything they're asking; either directly, or while talking about me to somebody else.

Now, I don't really agree with this "genius" characterization, and it can make me feel a bit awkward, but it shows that a lot of developers have a somewhat idealistic and nebulous notion of the "genius programmer" - the programmer that knows everything, who can do everything, who's never stumped by a problem, and of which ther

domenic /
Created February 10, 2017 19:28
Redirecting GitHub pages after a repository move

Redirecting GitHub Pages after a repository move

The problem

You have a repository, call it alice/repo. You would like to transfer it to the user bob, so it will become bob/repo.

However, you make heavy use of the GitHub Pages feature, so that people are often accessing GitHub will helpfully redirect all of your repository stuff hosted on after the move, but will not redirect the GitHub Pages hosted on

The solution

joepie91 /
Last active June 7, 2022 14:21
Monolithic vs. modular - what's the difference?

When you're developing in Node.js, you're likely to run into these terms - "monolithic" and "modular". They're usually used to describe the different types of frameworks and libraries; not just HTTP frameworks, but modules in general.

At a glance

  • Monolithic: "Batteries-included" and typically tightly coupled, it tries to include all the stuff that's needed for common usecases. An example of a monolithic web framework would be Sails.js.
  • Modular: "Minimal" and loosely coupled. Only includes the bare minimum of functionality and structure, and the rest is a plugin. Fundamentally, it generally only has a single 'responsibility'. An example of a modular web framework would be Express.


In software development, the terms "tightly coupled" and "loosely coupled" are used to indicate how much components rely on each other; or more specifically, how many assumptions they make about each other. This directly translates to how easy it is to repla

joepie91 /
Last active November 12, 2022 06:37
Getting started with Node.js

"How do I get started with Node?" is a commonly heard question in #Node.js. This gist is an attempt to compile some of the answers to that question. It's a perpetual work-in-progress.

And if this list didn't quite answer your questions, I'm available for tutoring and code review! A donation is also welcome :)

Setting expectations

Before you get started learning about JavaScript and Node.js, there's one very important article you need to read: Teach Yourself Programming in Ten Years.

Understand that it's going to take time to learn Node.js, just like it would take time to learn any other specialized topic - and that you're not going to learn effectively just by reading things, or following tutorials or courses. _Get out there and build things!

franga2000 / Ubuntu on Acer Aspire Switch
Last active January 29, 2023 10:01
Ubuntu on Acer Aspire Switch 10
View Ubuntu on Acer Aspire Switch

Ubuntu on Acer Aspire Switch

The problem

What's the problem with this tablet? Why can't I just insert the USB and mash F12 until it boots? The tablet is made to run Windows 8.1 and Windows 8.1 only. Some absolute genius at Acer decided to put a 32-bit UEFI on a 64-bit system, which no reasonable Linux distro supports out-of-the-box.

NOTE: This guide focuses on installing Ubuntu alongside Windows. If you're trying to replace Windows, then I assume you know enough about Linux to know which parts to change.

What works:

  • Keyboard
rlemon /
Last active June 27, 2019 12:19
copy of the deleted readme. I just stitched it together from the commit logs.


Typical reaction formulae for misandrists

####1. "Wow, just wow."

This is the #1 goto for misandrists. It discourages any actual logical discussion, and just implies that the person you are talking to is so ignorant that it is, somehow, totally impossible for you to hold any sort of fruitful discussion with them.

werty1st / sparse checkout
Created September 17, 2013 12:03
git sparse checkout
View sparse checkout
What you are trying to do is called a sparse checkout, and that feature was added in git 1.7.0 (Feb. 2012). The steps to do a sparse clone are as follows:
git init <repo>
cd <repo>
git remote add -f origin <url>
This creates an empty repository with your remote. Then do:
git config core.sparsecheckout true
Now you need to define which files/folders you want to actually check out. This is done by listing them in .git/info/sparse-checkout, eg:
sumardi / gist:5559896
Created May 11, 2013 12:56
Subdirectory checkouts with Git sparse-checkout
View gist:5559896
# New repository
mkdir <repo> && cd <repo>
git init
git remote add –f <name> <url>
git config core.sparsecheckout true
echo some/dir/ >> .git/info/sparse-checkout
echo another/sub/tree >> .git/info/sparse-checkout
git pull <remote> <branch>
# Existing repository