Gitignore-A-Palooza: Two Tricks

Posted on Sun 02 December 2018 in Software Development • Tagged with version control, Git

Most modern software developers are aware of Git and its accompanying gitignore file. This post offers two lesser-known-yet-useful techniques to ignore files from a Git-based version controlled project. The first technique enables Git to ignore every file in a directory but the directory itself. The second technique enables a user to automatically ignore a file without adding it to a project's root gitignore.

Continue reading

Python Function Pipelines

Posted on Sat 02 June 2018 in Software Development • Tagged with Python, Unix, pipeline, functional programming

If your Python code represents a function pipeline, it should look like a function pipeline. This post presents a simple, strongly-typed function pipeline for your personal projects to make beautiful, explicit, Unix-like pipelines in Python. Requires Python 3.6 or greater.

Continue reading

Smaller Python Docker Containers with Multi-Stage Builds and Python Wheels

Posted on Sat 21 April 2018 in Software Development • Tagged with Docker, Python, pip

If your Docker Python build requires system dependencies that are NOT required at runtime, structure your build as follows:

  1. Use a multi-stage build
  2. Stage 1 installs system dependencies and uses them to build local wheels
  3. Stage 2 begins from the same base as Stage 1, copies wheels from Stage 1, and installs the wheels
  4. The rest of your build will be based on Stage 2

If you follow these steps, you'll end up with the smallest-possible Python Docker container with all your Python dependencies intact.

Continue reading

Vim Line Numbers

Posted on Sat 07 April 2018 in Software Development • Tagged with Vim, Vim Plugins

If you want your Vim line numbers to be relative and/or not relative at the correct times, I recommend installing the myusuf3/numbers.vim plugin.

Continue reading