Directory Information Please

Sometimes a directory structure needs a little extra information. Even the most well thought-out directory names lack the expressiveness of a few short remarks. My solution for these cases has been to add a file named __dir_info__.txt to a directory requiring additional details. This file provides an explanation of the directory's purpose, which typically starts with This directory contains ..., and is formatted using AsciiDoc.

Let's look at an example:

= foobar
:date: 5 January 2015 …
more ...

Generating Documents With Jinja2 and YAML

Date Tags python

Quick example of generating documents by rendering data from a YAML file through a Jinja2 template. The target output is Latex vhistory data (revs.tex) which will be included in main document (main.tex). The output is generated by a Python script (create_revs_tex.py) from YAML data (revs.yaml).

import yaml
from jinja2 import Template

# For this example, assume that stdout will be redirected to `revs.tex`.
# In the template, the `{#--#}` entries are used to …
more ...

gArchiver Demo

Date Tags software

Made a quick video to demonstrate some of the features of gArchiver:

I use gArchiver frequently and it has proven invaluable. The ability to quickly add metadata to a zip file is handy. Here are a couple of typical use cases:

  • Keeping track of where files came from. When I need to keep a local copy of a received file, its useful to make a quick note of who sent it.
  • Grouping files together as …
more ...

Comment Groups

Date Tags software

Sometimes normal leading comments just aren't enough, instead a visual method of grouping blocks of code together is needed. The following pattern seems to work very well:

<comment-symbol>{-- <group-text> --
<code-here>
<comment-symbol>----}

Here is an example in C:

/*{-- Some grouped variables. --*/
/* Maintains foo-y stuff. */
int foo = 1;
/* Maintains bar-y stuff. */
int bar = 2;
/*----}*/

Here is an example in Python:

#{-- Some cool code here. --
foo = 1
bar = 2
#----}

Multi-line example in JavaScript:

//{-- Big long explanation of a …
more ...

Doctrine Goals

This past weekend, I started a side project named Doctrine. It is a desktop application that simplifies viewing the rendered output of an AsciiDoc text file. A quick demo video is shown below:

The motivation behind Doctrine is to streamline the user experience when writing documents in plain text markup. Currently I am only focusing on AsciiDoc but compatibility with other formats (Markdown, ReStructuredText, etc) could be added in the future (integration with Pandoc is …

more ...

Hacking Together HTML With YAML And Mustache

Forewarning, this is a hack and an ugly one too. Without getting into the backstory, the idea was to see if it is possible to render YAML data to HTML using a Mustache template, all locally (i.e. no server, just a single local HTML file). Turns out it is possible... sort of.

Before getting to the code, a few notes:

  • This probably shouldn't be used for anything ever (although it was a fun experiment …
more ...

Thoughts On Script Naming

For a while now, I have had the mindset that any high-level operation related to a software project should be captured as an OS-native script kept either in the repo's root directory or an appropriate subdirectory. For example, the following scripts are located in the root directory of my blog repo:

  • _Build_HTML.bat
  • _Cleanup.bat
  • _Deploy_SSH.bat
  • _Run_Test_Server.bat

A few things worth noting about the filenames alone:

  • The scripts are Windows-native batch files since …
more ...

C Polymorphism

Date Tags c

Polymorphism, when done right, is a powerful method of simplifying software implementation. There are multiple types of polymorphism, here is a simple example of runtime (aka dynamic) polymorphism in C:

#include <stdio.h>
#include <stdlib.h>

typedef struct animal_s {
    void (*speak)(void);
} animal_t;

void speak_like_a_duck(void)
{
    printf("quack!\r\n");
}

void speak_like_a_dog(void)
{
    printf("woof!\r\n");
}

animal_t *create_duck(void)
{
    animal_t *duck = malloc(sizeof(animal_t));
    duck->speak = &speak_like_a_duck;
    return(duck);
}

animal_t *create_dog(void)
{
    animal_t *dog …
more ...

Hi, I am Jeff Rimko!
A computer engineer and software developer in the greater Pittsburgh, Pennsylvania area.