Feet up!

Band of the week: Arthur Vance

Can I solo artist be "band" of the week, sure, it's my category, what I say goes!

Just to muddy the water further, Arthur's actually more of a song writer than a full-on rock star, and he didn't even play on Cool Creek his most famous track to date, but with a tune this good that really doesn't bother me, and it's an admirable bit of ego-control by Arthur. Cool Creek appeared on TPN Rock 15 and can be downloaded (alomg with 9 other cracking tracks) from Arthur's weblog, personally I'm really looking forward to hearing the other 11 tracks recorded by the guys.

[Thu, 18 Aug 2005 22:48] | [music/band-of-the-week] | #

Clipboard, fun, games, and magic

Interesting post by Gustaf bemoaning the fact that he can't seem to find an easy way to implement a very useful clipboard manipulation process in Windows.

The basic user action is simple, select some text, copy, run the manipulator, paste. In this case Aristotle was using to hook markdown (and smartypants) into the process of entering text in the the browser, but you could just as easily use any text manipulation tool. It's a great trick, rather like Roberto de Almeida's Textile favelet but even more generic.

Anyway, cutting to the chase, this is possible in Windows, you just need the right tools to get and put stuff from the clipboard. Enter UnxUtils, this is a port of many GNU utilities to Windows (without the hassles of Cygwin), and tucked away in this mass of useful tools are pclip.exe and glip.exe - pclip puts the clipboard onto stdout, and gclip gets stdout into the clipboard. There's even a one line example of how to use sed with these to do some string replacement, like so:

pclip | sed "s/string1/string2/g" | gclip

The markdown example sounded interesting to me, so I've implemented it to use PyTextile. Being Windows there's always gotchas, but it's not that complicated.

First off PyTextile won't read/write from stin/stout by default, so I wrote a one-liner in Python to grab stdin, stuff it into textile and print the output to stdout, I'm calling this PipeTextile.py, and it's as below:

import textile, sys
print textile.textile( ''.join( sys.stdin.readlines() ) )

Then I also needed a batch file to avoid having to type a long command line every time I want to run this process, I've put a shortcut to this on my taskbar, so the whole process is as quick as select, copy, click shortcut, paste. I've called the batch file TextileIt.cmd, and it's as below:

pclip | python PipeTextile.py | gclip

The only gotcha here is having to run the python interpreter explicitly because the windows shell is too stupid to run it implicitly. And that's it, problem solved, now I just need to brush up on my Textile syntax!

[Thu, 18 Aug 2005 08:47] | [tech] | #

About
Jim Hughes
Wiki (updates)

RSS for Feet up!
link to FOAF file
Full of LOAF
Flookie Blog Search


Web Sites
Ben Hammersley
Diego Doval
Erik Thauvin
Ewan Spence
Frank Koehntopp
Gustaf Erikson
Matt Croydon
Mark Pilgrim
Martin Little
MobHappy
Phil Wilson
The Register
Rui Carmo
Russell Beattie
Taptu's mobile chemistry blog
Tarek Abu Esber
techype
Terje Sørgjerd
Tom Hume
TPN Rock

pyblosxom logo

Archives
2013-Feb
2012-Jun
2012-May
2012-Apr
2011-Sep
2011-Aug
2011-Apr
2010-Dec
2010-Nov
2010-Oct
2010-Sep
2010-Aug
2010-Jul
2010-Apr
2009-Nov
2009-Oct
2009-Aug
2009-Jun
2009-May
2009-Feb
2008-Nov
2008-Oct
2008-Sep
2008-Aug
2008-Jul
2008-Jun
2008-May
2008-Apr
2008-Mar
2008-Feb
2008-Jan
2007-Dec
2007-Nov
2007-Oct
2007-Sep
2007-Aug
2007-Jul
2007-Jun
2007-May
2007-Apr
2007-Mar
2007-Feb
2007-Jan
2006-Dec
2006-Nov
2006-Oct
2006-Sep
2006-Aug
2006-Jul
2006-Jun
2006-May
2006-Apr
2006-Mar
2006-Feb
2006-Jan
2005-Dec
2005-Nov
2005-Oct
2005-Sep
2005-Aug
2005-Jul
2005-Jun
2005-May
2005-Apr
2005-Mar
2005-Feb
2005-Jan
2004-Dec
2004-Nov
2004-Oct
2004-Sep
2004-Aug
2004-Jul
2004-Jun
2004-May
2004-Apr
2004-Mar
2004-Feb
2004-Jan
2003-Dec
2003-Nov
2003-Oct
2003-Sep
2003-Aug
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002

AAS Webring logo
Previous | Random | Next
Join | List | Home
Powered by RingSurf