Sep. 3rd, 2009

elfs: (Default)

Anyone who’s ever worked with me knows that I’m inordinately fond of figlet, a program that creates banner letters out of ordinary text.  It works best as an example:

# figlet -w 200 -fsmall Here Be Dragons
 _  _               ___        ___
| || |___ _ _ ___  | _ ) ___  |   \ _ _ __ _ __ _ ___ _ _  ___
| __ / -_) '_/ -_) | _ \/ -_) | |) | '_/ _` / _` / _ \ ' \(_-<
|_||_\___|_| \___| |___/\___| |___/|_| \__,_\__, \___/_||_/__/
                                            |___/

I have these scattered throughout my source code, mostly to indicate to the user where he or she is, and what class and related material they’ll be working on. Since I work in Rich Internet Application development using Django, I frequently have many small applications, and I often have multiple stacks (Server Side, Templates, Javascript, and CSS) for each application, so I end up with lots of little bundles, and having these big roadsigns helps me know where I am. They show up nicely in Eclipse and Emacs.

But I get tired of having to transport the output of figlet into my code at any given point. So I wrote a little program to do it for me. It output python-style comments by default, and if you prefix your text with // it’ll spit out Javascript-style one-line comment lines instead. But the beauty of it is that second line, which automagically puts the comment into your primary selection clipboard– that’s the one pasted by your middle mouse button. After running autofig, the figlet is in your mouse button clipboard and you can drop it anywhere you want.  The figlet font “small” is hard-coded, but you can pick whatever you want.  Slant and eftiwater are lovely figlet fonts.  I’ve set the width to 200; that ought to be enough for anyone.  It outputs the text to the console so you can assess its look before you paste it.    Beauty, eh?

#!/bin/bash

P="#"
if [ $1 == "//" ]; then
  P="\/\/"
  shift
fi

figlet -w 200 -fsmall $* | sed 's/^/'$P' /'
figlet -w 200 -fsmall $* | sed 's/^/'$P' /' | xclip -in -selection primary

Postscript: Typing ‘figlet’ consistently proved to be harder than I thought. Years of typing ‘gif’ has poisoned my typing rhythm.

This entry was automatically cross-posted from Elf's technical journal, ElfSternberg.com
elfs: (Default)
Space Needle emerges from the Fog
Space Needle emerges from the Fog
The day started off normal enough. I had to make a run up to the University District for some office supplies, and on the way back saw this great image of the Space Needle peeking through heavy fog. It was pretty enough that I tried to get a photo of it ,but unfortunately I shot through glass and didn't aim too well.

Paleobrutalist Architecture
Paleobrutalist Architecture
On the way home, I walked past this thing. I'd forgotten that there were examples of the 1960's "brutalist" architectural movement in downtown Seattle. This building is actually abandoned, with a huge "for lease!" sign on top, chain link fencing all around, and covered with graffiti on the bottom floor.

Giant Stuffed Puppets, Again
Giant Stuffed Puppets, Again
Also on the way home: Leftist protestors with their giant puppet. This is obviously a George Bush puppet that has been repurposed into a giant healthcare-sucking vampire of some sort. Also very Seattle: Recycling.

Yeah, giant street theater puppetry. It's just so compelling, isn't it? So convincing. I mean, who do they think they're doing this for? The right doesn't do this kind of crap; they just bring guns.

Police steeds
Police steeds
On the walk to the train station, I passed by the Seattle horse cop just casually watching people walking by. I have to wonder what value add a horse is in the city, compared to a bicycle. On the last leg home, after picking up the car once again from the Park & Ride, I snapped this photo of an officer waiting at a stoplight. He was driving one of the brand new motorcycles the city of Issaquah bought last year. The contrast between the two fascinated me.
elfs: (Default)
A couple of years ago, back when we were insane with fear that there were Brown People Under Our Beds, there were numerous articles on catching spies and terrorists, and during that time a word became well, not "popular," but certainly frequent, in those articles.

The word was a verb counter-espionage people use to describe what they do to a spy's surroundings when they find him. They take everything around him, and I mean everything, and run in through analysis to see if it contains codes, messages, hints, or what have you. And there was a specific word agents used for this process.

What was that damned word?

Profile

elfs: (Default)
Elf Sternberg

December 2025

S M T W T F S
 12345 6
78910111213
14151617181920
21222324252627
28293031   

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jan. 7th, 2026 09:19 am
Powered by Dreamwidth Studios