SQLite phiresky.github.io

Hosting SQLite databases on GitHub Pages

The benefits of such a setup are numerous, especially for small sites and side projects:

Hosting a static website is much easier than a “real” server - there’s many free and reliable options (like GitHub, GitLab Pages, Netlify, etc), and it scales to basically infinity without any effort.

The how is also super interesting:

So how do you use a database on a static file hoster? Firstly, SQLite (written in C) is compiled to WebAssembly. SQLite can be compiled with emscripten without any modifications, and the sql.js library is a thin JS wrapper around the wasm code.

There’s more to the story, and the resulting solution is also open source.

Mark Eriksen fly.io

Building a distributed turn-based game system in Elixir

Mark Eriksen:

Many great Phoenix LiveView examples exist. They often show the ease and power of LiveView but stop at multiple browsers talking to a single web server. I wanted to go further and create a fully clustered, globally distributed, privately networked, secure application. What’s more, I wanted to have fun doing it.

So I set out to see if I could create a fully distributed, clustered, privately networked, global game server system. Spoiler Alert: I did.

I like the way he frames his experience. He says the most remarkable thing about it is not what he built, it’s what he didn’t need to build in order to accomplish his goal.

CloudZero Icon CloudZero – Sponsored

10+ AWS cost management best practices

logged by @logbot permalink

While there are many advantages to using Amazon Web Services (AWS), cost management can be complicated because so many factors impact your AWS bill. Account setup, savings plans, and a number of other factors can all affect your AWS charges and usage.

In this article, we’ll introduce 10 AWS cost management best practices that promote optimization, and how you can go beyond AWS cost management by using an advanced cloud cost intelligence tool.

Node.js github.com

google/zx – a tool for writing better scripts

Bash is great, but when it comes to writing scripts, people usually choose a more convenient programming language. JavaScript is a perfect choice, but standard Node.js library requires additional hassle before using. zx package provides useful wrappers around child_process, escapes arguments and gives sensible defaults.

I wouldn’t say JavaScript is a perfect choice for this kind of scripting, but it’s definitely a suitable one (especially if it’s the language you already know well). Here’s what scripting looks like with zx:

#!/usr/bin/env zx

await $`cat package.json | grep name`

let branch = await $`git branch --show-current`
await $`dep deploy --branch=${branch}`

await Promise.all([
  $`sleep 1; echo 1`,
  $`sleep 2; echo 2`,
  $`sleep 3; echo 3`,
])

let name = 'foo bar'
await $`mkdir /tmp/${name}`

Top-level await sure makes things nicer. (Deno supports this out of the box, btw.)

Nat Bennett simplermachines.com

What happens when you pair all day, most days, for years?

There are obvious upsides to pair programming. This post from Nat Bennett shares both the ups and the downs of pairing all day for years…

So I paired all day, most days, for about five years. This had a lot of upsides, far more than I can list here. There’s a standard list of benefits and drawbacks to pairing that you might be familiar with, but the impact of pairing, especially pairing that much, goes much deeper than its impact on the code, on the particular work the team delivers that week.

Nat goes on to share when pairing took more than it gave for them.

Pairing requires being vulnerable, to another human being, for hours at a time. Intimacy, both physical and mental. I had to share space, decisions, thought processes, and often feelings with this person. … This never stopped being draining.

Over time, over years, pairing wore me down. Took a little bit more each day than I could recover. Until my life was working, and recovering from work, and then working some more.

Paul Graham paulgraham.com

Crazy new ideas

Paul Graham on preposterous sounding ideas and how easy they are to dismiss:

Most implausible-sounding ideas are in fact bad and could be safely dismissed. But not when they’re proposed by reasonable domain experts. If the person proposing the idea is reasonable, then they know how implausible it sounds. And yet they’re proposing it anyway. That suggests they know something you don’t. And if they have deep domain expertise, that’s probably the source of it.

Such ideas are not merely unsafe to dismiss, but disproportionately likely to be interesting. When the average person proposes an implausible-sounding idea, its implausibility is evidence of their incompetence. But when a reasonable domain expert does it, the situation is reversed. There’s something like an efficient market here: on average the ideas that seem craziest will, if correct, have the biggest effect.

I’m not a big ideas guy. Never have been. Adam is, though. And I freely admit that many of his ideas sound preposterous to me at first. But I’ve learned over the years to hear him out, because he’s usually on to something, even if it’s not fully-formed yet. And it turns out I’m pretty good at taking partially-formed ideas and helping firm them up. This is one of the reasons why we make a good team.

Having new ideas is a lonely business. Only those who’ve tried it know how lonely. These people need your help. And if you help them, you’ll probably learn something in the process.

Hidde de Vries hiddedevries.nl

Criticism pushes the web forward

Hidde de Vries takes a strong, reasoned stance to online criticism of others’ work:

This week, a friend shared a blog post that critiqued a popular framework for CSS. Twitter started to discuss if it’s okay to criticise tools. In this post, I’ll say it is not just okay, it is also important.

This is a tough subject because we identify so closely with the things we create (our code), but Hidde is right: if we want to progress as an industry (and individually) we need to be able to criticize (constructively) and receive criticism. It’s part of the process.

We should give feedback respectfully and constructively, but we should give feedback. And open up to feedback, not demand it to go away. It may not be easy, but it is important to include perspectives outside your own.

Teleport Icon Teleport – Sponsored

Setting up an SSH jump server

logged by @logbot permalink

An SSH jump server is a regular Linux server, accessible from the Internet, which is used as a gateway to access other Linux machines on a private network using the SSH protocol. The purpose of an SSH jump server is to be the only gateway for access to your infrastructure reducing the size of any potential attack surface.

In this blog post we’ll cover how to set up an SSH jump server. We’ll cover two open source projects.

  1. A traditional SSH jump server using OpenSSH. The advantage of this method is that your servers already have OpenSSH pre-installed.
  2. A modern approach using Teleport, a newer open source alternative to OpenSSH.

Both of these servers are easy to install and configure, are free and open source, and are single-binary Linux daemons.

API pirateweather.net

A weather forecast API to replace Dark Sky's

You may have heard that Dark Sky (the beloved weather app for iOS) was acquired by Apple and its accompanying developer API will be shut down soon, which left a lot of devs scrambling for alternatives. Enter the PirateWeather API:

Weather forecasts are primarily determined using models run by government agencies, but the outputs aren’t easy to use or in formats built for applications. To try to address this, I’ve put together a service (built on AWS Lambda) that reads public weather forecasts and serves it following the Dark Sky API style.

It’s in beta at the moment, but it appears the author has put a lot of thought into it.

Stripe Icon Stripe

Guide to managing founder stress

Stripe Atlas has a wide array of guides to running an internet business that are totally open and free for everyone. This guide, written by Dr. Sherry Walling (a clinical psychologist), on “managing founder stress” covers everything from running smart (not just hard), coping with chronic stress, mastering the ups and downs, and a reminder that as a founder you are not alone.

If you like this guide, then you’ll probably be a fan of my podcast Founders Talk too.

0:00 / 0:00