Nerderati
github mastodon
aboutfeed Light Dark
Posts.
  • 2024-10-28

    Automatically run `uv sync` on git branch change

    This is a bit of a silly post: it's relatively trivial, but someone asked me if this was possible the other day and I realized that it's perhaps not so trivial if you're unfamiliar with the various bits of necessary tooling.

    …
    Read more ⟶
  • 2024-09-23

    MVP table stakes

    Creating new apps has never been easier! Or so I've been told.

    What I have noticed is that customers expect a certain baseline of functionality. Features that they have grown accustomed to. Features and functionality that exists in other, more mature applications. Applications and services with teams and teams of engineers and managers behind them. You know, easy stuff.

    …
    Read more ⟶
  • 2024-07-25

    Tracing the evolution of a Python function with git log

    Have you ever been frustrated by the amount of noise you have to wade through with git log -p -- <filepath>? What if there was a way to narrow down the diff output so that you could see how a single function or method evolved over time, and ignore all the other cruft that you don't care about?

    As with most things git, there's an obscure and underutilized option in the docs that can do exactly that!

    …
    Read more ⟶
  • 2024-07-15

    A Python Epoch Timestamp Timezone Trap

    Date and time handling in software has always been a pain point — because date-time math and timezones are hard! — and Python has has historically made some ill-advised choices in the past that catch even the most seasoned developers off-guard.

    …
    Read more ⟶
  • 2024-07-11

    How to differentiate between empty strings and NULL values in the psql CLI

    The PostgreSQL interactive CLI has the wonderfully convenient \pset command, which can be invoked to modify the display output of query results.

    …
    Read more ⟶
  • 2020-08-10

    Use a Pretty Printer by Default in Python Shell Contexts

    I can't believe it took me years to figure this out, but you can very easily set the pprint.pprint function as the default implementation to use when calling print() during the invocation of a shell or when running a program under the python interpreter.

    …
    Read more ⟶
  • 2020-04-20

    Speed Up Pylint By Reducing the Number of Files It Examines

    Pylint is a great linter, but it can be horrendously slow to run on anything but the most trivial of code bases.

    …
    Read more ⟶
  • 2018-06-27

    Leveraging De Morgan's Laws to Rewrite Boolean Expressions

    Sometimes the logic in your application get a bit out of hand, and ends up an unreadable, tangled mess of negated conjunctions and disjunctions. A judicious application of De Morgan's Laws can help you translate confusing expressions or sub-expressions to something a bit more readable, while maintaining the same logical truths and falsehoods that you originally intended.

    …
    Read more ⟶
  • 2018-03-16

    Slack, Messaging Services, and the Overton Window

    Slack has recently begun phasing out their IRC and XMPP gateways, indicating that:

    [We] can make no guarantee about the security of any IRC/XMPP client (including transport encryption or data security).

    along with the statement that it is not possible for them to maintain feature compatibility of their application across these various protocols and transports.

    …
    Read more ⟶
  • 2018-03-13

    What Shaving Can Teach Us About Software Development

    A few months ago, I started to shave using a straight razor.

    …
    Read more ⟶
  • 2018-03-09

    Github is forcing me to change my username, and will not tell me why.

    A few days ago I received an email from support@github.com:

    …
    Read more ⟶
  • 2018-02-14

    The Container Craze

    Containers are everywhere: it's hard to go a day without hearing about the latest Docker feature, the newest post about how Kubernetes has revolutionized devops, or wondering how you'll ever get employed if you don't live and breath and blog daily about containers.

    …
    Read more ⟶
  • 2017-06-09

    MIME Encoded Words in Email Headers

    A coworker of mine, Andreas Birkebæk, received an email the other day, and sent it to me thinking that it was some variation of a unicode failure that plagues me regularly. While it was an encoding failure of sorts, this one was more interesting than your garden-variety UTF-8/ISO8859-1 problem.

    …
    Read more ⟶
  • 2017-01-03

    PostgreSQL Tables Can Only Have 1600 Columns, Ever.

    I ran into a situation today that was particularly frustrating, but for an interesting reason.

    PostgreSQL tables are hard-limited to a maximum of 1600 columns. The limit, as I found out after a bit of digging, is specified in the PostgreSQL source and accompanied by a short explanation:

    …
    Read more ⟶
  • 2016-11-04

    Hello, My Name is Joël.

    Well, Not really.

    My name is, in fact, Joël. You'd never guess that, however, from the consistent and diverse ways in which my non-ASCII given name is butchered by web applications, email servers, databases, and overzealous baristas that seem to believe I am the father of Superman.

    …
    Read more ⟶
  • 2016-08-15

    Using CloudFront to Bypass AWS S3 Static Website Hosting Name Requirements

    Amazon Web Services has the ability to serve objects contained within an S3 bucket as a static website. Upload some files to a bucket via their web-based console or via their API (as implemented in boto), flip a switch that indicates the bucket in question is to be used for this purpose:

    …
    Read more ⟶
  • 2016-07-06

    Why DHCP Lease Expiration Matters for Your Coffee Shop Router

    I often find myself working out of a café.

    Nearly all of my work requires an internet connection at some point or another, which means that most of the cafés I frequent have some sort of WiFi that I take advantage of. While I'm not generally one to complain about the quality of free WiFi in the small, locally run establishments in my neighbourhood, it does frustrate me that they are often misconfigured to the point where the staff must reset the router every few hours.

    …
    Read more ⟶
  • 2014-09-03

    Installing Matplotlib, NumPy, SciPy, NLTK, and Pandas on OS X

    I don't know exactly why, but installing science/math/statistics oriented Python packages on OS X has historically been a complete pain in the ass. It seems as though things have improved over the past few years with the development of custom disk images, meta-package installers and other fanciful things, but most of these solutions sacrifice the ability to upgrade the given packages or link against custom builds of supporting libraries due to overly aggressive sandboxing to ensure that things Just Work™.

    …
    Read more ⟶
  • 2014-08-19

    Bartering for Beers with Approximate Subset Sums

    My favourite days are the ones where I get to solve a seemingly difficult everyday problem with mathematics. A few weeks ago, my friend Andrei came to me via IRC with a question, which I have heavily paraphrased:

    I've got a list of the beers in my cellar, and each beer has a price associated with it. I'd like to figure out how to generate a list of fair trades between myself and another person who has their own list of beers and prices, for any combination of bottles between the two of us.

    Or, more generally: given two lists of items, each item with a fixed value, how may we calculate the possible combinations of “equal” groups of one or more items for each list when comparing to the other list in question?

    …
    Read more ⟶
  • 2011-03-17

    Simplify Your Life With an SSH Config File

    If you're anything like me, you probably log in and out of a half dozen remote servers (or these days, local virtual machines) on a daily basis. And if you're even more like me, you have trouble remembering all of the various usernames, remote addresses and command line options for things like specifying a non-standard connection port or forwarding local ports to the remote machine.

    …
    Read more ⟶
  • 2011-03-15

    Ideas of March

    Four years ago when I started using a micro-blogging service, I revelled in the sheer simplicity and low barrier to communicating my thoughts. Blogging, in that era, seemed like a historical vestige on the verge of being consumed and overtaken by the rapid fire, real-time tweets of my peers. I jumped on that bandwagon, and never looked back. Until now.

    …
    Read more ⟶
  • 2011-03-11

    Code Your Art Out

    Ever since I had the pleasure of keynoting at Make Web Not War: For The Web in 2010, I've been eagerly awaiting the announcement of the 2011 edition, which was announced just a few days ago.

    …
    Read more ⟶
  • 2010-11-29

    Perpetual IRC - The Proxy Edition

    Last time, we looked at how one could maintain a persistent session in IRC through the use of a terminal multiplexer (such as screen or tmux) and SSH. While this has the advantage of being very easy to setup, there are a few very obvious disadvantages and trade-offs:

    …
    Read more ⟶
  • 2010-09-07

    Perpetual IRC - The Multiplexer Edition

    As is the case with most people involved in Open Source, I'm on IRC all day long. I can help people from around the world use some of the projects I've helped create, as well as some of the software that I use on a daily basis.

    One of the major advantages that IRC has over your ‘traditional’ instant messenger clients is that, with a minimum amount of effort and hardware, you can create a setup that will remain perpetually connected, even when you're not online. That means that you can keep logs of conversations, receive messages, catch up on what the current topic of discussion is when starting your day, and still be able to shut down your computer at night if you so choose.

    There are a few ways of achieving the status of perpetual IRC denizen. Note, however, that almost any method requires that you have access to a remote server in addition to your local machine. It doesn't need to be anything special - a cheap VPS will do just fine, as long as you can install software packages and open the necessary ports in the firewall.

    …
    Read more ⟶
  • 2010-07-26

    Compiling Vim With Ruby Integration On Snow Leopard

    One of my favourite plugins for Vim is command-t:

    An extremely fast, intuitive mechanism for opening files with a minimal number of keystrokes. It's named "Command-T" because it is inspired by the "Go to File" window bound to Command-T in TextMate.

    Sadly, the default installation of Vim on Snow Leopard does not have support for the ruby interpreter compiled in, which is a pre-requisite for using the plugin. Luckily, that's easy enough to remedy, and in the process we'll learn a thing or two about compiling your own custom Vim binary.

    …
    Read more ⟶
  • 2010-05-20

    WebNotWar

    I'm quite happy to announce that I will be giving the keynote address at this year's WebNotWar/For The Web conference, taking place on May 27th, 2010.

    …
    Read more ⟶
  • 2010-05-04

    Suggested Reading

    Some of my current favourite books on rotation:

    …
    Read more ⟶
  • 2010-02-26

    Bijective Function Domains on Words in the English Language

    If you were to apply a bijective function to each letter in each word of a language (e.g. English), how many pre-existing words would you obtain in the resulting image?

    …
    Read more ⟶
  • 2010-01-31

    Shebang

    An explanation of the shebang, and what it means when included in a script:

    …
    Read more ⟶
  • 2010-01-04

    Redis Memory Monitoring - Python Edition

    A few hours ago, Salvatore Sanfilippo (the lead developer of Redis), tweeted a little Ruby script to interactively estimate the memory usage of a running redis-server instance:

    …
    Read more ⟶