Recent Posts

  • Excerpts for Eleventy: My Implementation

    | 4 minutes read

    Converting my relatively basic personal website to Eleventy has shown me how challenging it is to build a static-site generator flexible enough to satisfy all the user cases and requirements. The great thing about Eleventy is being simultaneously opinionated by default and yet extremely flexible and customizable.

    One area where everyone seems to have different requirements are reproducing blog post excerpts on the site’s home page. Here are my wants:

    • By default, use the start of the content (up to a delimiter)
    • Optionally, define the excerpt in the front matter configuration
    • Markdown is parsed exactly the same as the original post
    • Include images but allow custom styling on the home page
    • Syntax highlighting

    Here is how I implemented each of the requirements.

    read article
  • UTC/Local Date Conversion in Perl With Time::Piece

    | 4 minutes read
    #coding #perl #dates

    Time::Piece is my preferred perl module for handling dates. Here is how it can be used to convert between UTC and the local time, even for past dates which may have crossed the current daylight savings time status.

    read article
  • Excalidraw: Add Padding Around Exported Image

    | 1 minute read
    #excalidraw #svg

    My favorite app for creating diagrams is excalidraw. It is a free, open-source, web application that has all the features necessary to quickly create almost any kind of workflow image. The user interface is terrific and easily grokked by anyone familiar with drawing apps. You can export images in either SVG or PNG formats.

    There was only one thing that bothered me about the app. When images are exported, there is no padding or margins around the image, which can make them hard to work with. I wasn’t the only one with the issue and someone opened a github issue to discuss possible solutions. In the end, the issue was closed without a resolution, because there didn’t seem to be a generic solution that would please everyone.

    read article
  • SVG Files in Adobe Illustator

    | 5 minutes read
    #webdesign #svg #css #illustrator

    Although it has gotten better over the years, Adobe Illustrator doesn’t automatically produce SVG files completely suitable (or optimal) for websites.

    This document is an opinionated process for creating suitable web SVGs. A “suitable web SVG” is one that can be easily and quickly tweaked by a developer by editing the code directly. It is also optimized to make it easy to embed in HTML or CSS files.

    read article
  • Regex is a Programming Superpower!

    | 3 minutes read
    #coding #perl #regex

    I Am Devloper Regex Tweet

    In an August 15 tweet, @iamdevloper, a very funny programmer-humor account, asked which technology you wouldn’t bother to learn over again: JavaScript, Regex, Kubernetes, or PHP. Never mind the completely obvious answer (if you aren’t in operations at Google, you probably don’t need Kubernetes), I was blown away on how many of the responders admitting to not knowing Regex.

    read article
  • Using ack to search Apache web logs

    | 1 minute read
    #coding #perl #apache

    The ack utility uses Perl regular expressions to efficiently search source code, with smart defaults to limit the results to what you expect.

    One of the ways I use it is to search our Apache web log files. The logs capture all requests, including ones for images, style sheets, fonts, and javascript files. But usually I’m only interested in who visited which web pages, including CGI scripts.

    I’ve added a Bash function to my .bashrc file, acklog, that filters out the extraneous files automatically:

    # ack (grep) for scripts in apache
    function acklog() {
      ack "$@" | ack -v '\.(css|eot|gif|ico|jpe?g|js|png|svg|swf|webp|woff2?|xml)[? ]'
    read article
View All Posts