Sorting your downloads directory can be tedious, especially if you want to move files to destinations that aren’t immediate subdirectories. Worse, there is no one-size-fits all viewer that can handle static images, animated gifs, and video files all at once.
This is where triage.py comes in.
Monitoring events in the console can be tedious, especially if the text looks mostly the same. Here’s a script that makes the movement easier to see.
The East Coast suffered Hurricane Sandy today. With the lights flickering off for brief moments every half hour or so, I decided it was time to stop hastily typing “ping” commands to diagnose my connectivity problems and so I wrote something to do it better. The result is a script that intelligently tests your networking hardware for connectivity.
It does 3 things:
- Ping the local gateway to make sure the hardware is working
- Ping the ISP to make sure that link is working
- Ping an Internet address to make sure that connectivity exists
Blasting ICMP packets at the Internet as fast as you can is not considerate. You want to ping your gateway quickly so that you know immediately when it comes up. Once you have internet connectivity though, you can ping more slowly.
Sometimes you want to apt-get installer packages in Debian or Ubuntu Linux, but downloading a lot of them in series can take a really long time. Here’s a script that does it for you; all you do is tell it what packages, and it fetches all the dependencies.
A full listing is below.
There are many times in code development when you need to run a bunch of commands after saving a file. You may even do it repeatedly. This shell script (listed below) automates that by watching a set of files, and executing a command if any of their modification times change.
I’m pleased to announce that the latest version of FontClustr, which is freely available on GitHub, now supports an interactive HTML tree for browsing its output.
This is a step toward an interactive font chooser that sorts by appearance.
When I go looking for a good typeface, I usually have a few styles in mind that I want to try out. Once I pass over some fonts that I definitely don’t want to use, it’s handy to be able to collapse the list. This is now possible, by clicking on one of the colored vertical bars to the left of the font previews.
In this case, I am clicking on the bright red bar to hide all the entries attached to it.
Currently, this action is not very aesthetic; the tree is changed instantly — without animation. Additionally, the excess space is not taken up in a logical way, so if you collapse a big section then it might be ambiguous as to whether the other fonts slid up or down to fill the void.
Still, its one less thing between me and the perfect typeface for whatever I’m doing.
Not counting the padding the font previews here are 50px in size. Collapsing them makes them fit into 20% of the original amount of space.
My FontClustr project has received honorable mention in the 2011 Catalyst Award competition! As an outsider to the world of graphic design, I’m touched that they found my work so inspiring.
From the press release:
The judges were impressed by the approach taken by this self-confessed non-typographer to a practical problem: how to automate grouping of different typefaces based on design similarity, so that users can see them “in the context of the visual landscape they collectively form”. … [The] FontClustr tool is an admirable example of an outsider’s analytical approach to the problem of typeface categorisation or grouping.
I’m pleased to announce that I’ve just developed a sorting algorithm in C++ whose worst case performance is O(n). I have named this algorithm ijk_sort (“ijk” is pronounced “ike” as in “Dijkstra“).
You can download the source of ijk_sort.cpp, reprinted below:
Here is a basic example (C++ file, Lua file, CMake file) of how to create a Lua environment inside C++, call a Lua function from C++, and have that Lua function make a function call to the C++ environment that contains it.
This demo covers functions with a variable number of arguments, multiple return values, and error handling.
I also include a sample CMake file to build it.