In the past I have already worked with a project that consisted of multiple Git repositories in a common project folder. For tracking each repository’s individual state together, Google’s repo tool was used. I ended up using mostly its powerful repo forall subcommand to execute various bash or git commands over the whole or subset of those projects.
Now, I was faced with the same situation, but without repo already in place. Could I get some of that forall feeling back, but without installing that (relatively) giant tool? It turns out, 9 lines of bash give me most of what I missed:
If you are stuck on Windows for any reason but got most of your fun Linux tool with you, good chances are you are using Windows Subsystem for Linux (WSL). With it comes a full Linux distribution (I use Ubuntu, but there are plenty of options: Alpine, Debian, Fedore, Kali, openSUSE) backed by their whole package ecosystem behind them. Historically, you could only run command line tools, but even GUI support for running graphical applications is now (since April 2021) available as a preview feature.
Ok, back to this post’s topic: say you are using Git within WSL to work on some code project. But unfortunately, for some reason, that project’s main development server only supports HTTPS authentication. Typically, this would cause you to have to interactively authenticate by Username + Password on every git fetch or git push operation. Not so much fun.
If you are on Linux, you have some options available (with the good recommendation: if SSH is possible, use it!), but under WSL, you can use a simpler trick.
For my blog, I use the WordPress theme Twenty Sixteen that supports adding links to my profile on typical social media sites like Facebook, Twitter, Instagram et al. For these well-known names, the theme automatically inserts company logos in the circular link symbols:
For smaller sites, the bundled Genericons font however does not provide those symbols. In my case, I wanted to add a symbol for the federated social networks Diaspora* and Mastodon, as well as set a custom paperclip symbol for my oj.do shortlink domain. Additional constraint: I only wanted to modify my own Twenty Sixteen child theme, so that I could continue benefiting from updates in the parent theme. Here’s how I did it:
The following bash function (e.g. stored in your ~/.bash_aliases) finds all files within a directory that was changed on a specific date. I use this to retroactively check on all my activities throughout a day. For code-related changes, a filtered git log certainly is better, but this includes file downloads, modified text documents in one search query, if aimed at my home directory.
This is an update to my 2015 post on horizontally aligning text in beamer columns with surrounding text. In this article, I am going to add the request to also justify alignment of all text. At the same time, I am simplifying the solution from last time:
When I want to save the current state of a pandas DataFrame for “manual consumption”, I often write df.to_excel('foo.xlsx') within my IPython session or Jupyter Notebook. However, the default style does not look pretty and often needs manual adjustments (e.g. column widths) to be usable.
If you want to create custom reports from pandas, you therefore might want to to this styling programmatically. Package openpyxl does this job nicely. Here is a motivational example that shows you the basic ways of its API. First, have some random data:
This posts documents an easy to miss feature supported by several LaTeX IDEs, TeXstudio in my case. They allow to cut short some otherwise tedious steps when switching between documents, by embedding a part of this variability into comments within the source files. This increases the portability of a document between TeX installations, increasing the chance that a simple Open and Compile of the source document succeeds on the first try, without first having to read the error log…
I recently switched on tikzexternalize on a document with several figures created by TikZ in it. Activating this Tikz library has the advantage of compiling the figures only once (if unchanged), speeding up the creation of the completed document. As a nice side benefit, one gets the images as separate PDF files, which in my case was the main motivation. One simple call to ImageMagick later, one has all images in a format of choice. However, I could not get it to work at first due to my using the PGFgantt package to create a gantt time chart. Here is the (not compiling) start point: Continue reading “How to use TikZ externalize with PGFgantt”
Through a custom child theme and 6 carefully built CSS rules, I have completely darkened all remaining bright elements of my WordPress installation. Here’s the result.
Roughly each year, WordPress releases a new default theme that ships with a fresh WordPress installation. As of writing, this blog relies on Twenty Sixteen. Through its Customize option, it is possible to change most colours of the theme without having to dive into the editor at all. However, this left me with some elements that were to bright for my taste: text inputs, buttons and widget borders. So I had to use some custom styles to complete the transition. Read on for all the boring details! 🙂 Continue reading “How-to make WordPress theme Twenty Sixteen completely dark”