<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>michael-mccracken.net &#187; scripts</title>
	<atom:link href="http://michael-mccracken.net/category/scripts/feed/" rel="self" type="application/rss+xml" />
	<link>http://michael-mccracken.net</link>
	<description>This is a weblog</description>
	<lastBuildDate>Fri, 13 Apr 2012 20:24:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>go juggle &#8212; an attention callback</title>
		<link>http://michael-mccracken.net/2008/08/go-juggle-an-attention-callback/</link>
		<comments>http://michael-mccracken.net/2008/08/go-juggle-an-attention-callback/#comments</comments>
		<pubDate>Fri, 29 Aug 2008 02:31:05 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[computers]]></category>
		<category><![CDATA[productivity]]></category>
		<category><![CDATA[scripts]]></category>
		<category><![CDATA[X Windows]]></category>
		<category><![CDATA[script utility productivity]]></category>

		<guid isPermaLink="false">http://michael-mccracken.net/wp/?p=119</guid>
		<description><![CDATA[I talk about a script I've been using to tweak my attention scheduling.]]></description>
			<content:encoded><![CDATA[<p>Sometimes progress on a project for me consists of a few short bursts of activity in between stretches of waiting for some long-running thing to complete so I can figure out what I need to do with it next.</p>

<p>Because I always have more than one project going, I don&#8217;t actually wait much. I just switch workspaces and try to make progress on the next thing. If I can&#8217;t make progress on anything immediate, I&#8217;ll end up checking email or looking up something for a side project.</p>

<p>This kind of multitasking is inefficient, but inevitable when I might have to wait for 20 minutes or more for a compute job or a compile to finish.</p>

<p>The problem with this approach is that the things I&#8217;m waiting for often finish while I&#8217;m off doing something else, and if I get too involved, the low-priority research or emails will eat up my day while the high-priority work sits waiting for me.</p>

<p>I&#8217;ve attacked this problem in the past when using OS X with <a href="gr">growl</a>, but I can&#8217;t call growlnotify from remote systems. However, I just found <a href="dzen">dzen</a> for X Windows, a lightweight notification display utility that compiles easily on every system I&#8217;ve tried, and works remotely with ssh X forwarding.</p>

<p>I wrote a simple script called <code>go</code>, which just executes its arguments and runs <code>dzen</code> when it&#8217;s done. Now I type (for example) <code>go make</code> and I can switch over to something else, confident that I&#8217;ll see a big popup window letting me know when I can get back to working on my highest priority project.</p>

<p>Here&#8217;s basically the entire <code>go</code> script:</p>

<p><pre></pre></p>

<h1>!/bin/ksh</h1>

<p>echo $@
$@
echo $@ completed on <code>hostname</code> \
 | dzen2 -p -h 64 -bg darkblue</p>

<p></p>

<p>It&#8217;s simple but it&#8217;s working great for me. I&#8217;ve tried some improvements like randomizing window placement to avoid overlapping notifications, but the simple version above really does all I need.</p>

<p>Finally, a couple of details. zsh always seems to want to spell-check &#8216;go&#8217;, so I really named it &#8216;~/bin/executeAndNotify.sh&#8217; and just aliased &#8216;go&#8217; to that.
Also, I&#8217;ve found it can mess with shell quoting as is, so sometimes I have to do <code>'somecommand ; go echo done'</code>. If someone has a tip on getting the quoting right in the script, I&#8217;d love to hear it. The problem crops up when you try something like &#8216;go make CC=&#8221;cc -g&#8221;&#8216; &#8211; the quotes don&#8217;t make it through.</p>
]]></content:encoded>
			<wfw:commentRss>http://michael-mccracken.net/2008/08/go-juggle-an-attention-callback/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Twitter Stats in SVG using gnuplot</title>
		<link>http://michael-mccracken.net/2008/01/twitter-stats-in-svg-using-gnuplot/</link>
		<comments>http://michael-mccracken.net/2008/01/twitter-stats-in-svg-using-gnuplot/#comments</comments>
		<pubDate>Wed, 02 Jan 2008 20:15:15 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[scripts]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://michael-mccracken.net/wp/2008/01/02/twitter-stats-in-svg-using-gnuplot/</guid>
		<description><![CDATA[A quick recipe for getting twitter stat graphs without Numbers.]]></description>
			<content:encoded><![CDATA[<p><a href="http://twitter.com/dacort">Damon Cortesi</a> just shared a handy script for grabbing your tweets and compiling some stats about when you post to twitter and who you reply to.</p>

<p>His script generates a list of numbers and included a Numbers template to paste them into. Since I don&#8217;t have Numbers, I&#8217;ve modified <a href="http://dcortesi.com/2007/12/27/twitter-stats/">his script</a> to write a file that can be read by <a href="http://gnuplot.info">gnuplot</a>, and wrote a basic gnuplot script to output an SVG file version of the stats.</p>

<p>While I was at it, I changed it so it no longer counts &#8220;@someone&#8221; separately from &#8220;@someone:&#8221;.</p>

<p>Both scripts are right here &#8211; <a href="http://michael-mccracken.net/twitter/gnuplot_twitterstats.tgz">gnuplot_twitterstats.tgz</a></p>

<p>It uses gnuplot 4.2, which you can get on OS X with <a href="http://www.macports.org/">macports</a> using <code>port install gnuplot +no_x11'</code>. (Or it&#8217;s a pretty easy build on its own, see the <a href="http://gnuplot.sourceforge.net/download.html">gnuplot download page</a> )</p>

<p>Here are my stats:
<object data="http://michael-mccracken.net/twitter/2007stats.svg" type="image/svg+xml"> Sorry, it looks like your browser doesn&#8217;t support SVG. You&#8217;re really not missing much.</object>
<a href="http://michael-mccracken.net/twitter/2007stats.svg">Click here for a full-screen version.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://michael-mccracken.net/2008/01/twitter-stats-in-svg-using-gnuplot/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>A script for text placeholders in VoodooPad</title>
		<link>http://michael-mccracken.net/2007/03/a-script-for-text-placeholders-in-voodoopad/</link>
		<comments>http://michael-mccracken.net/2007/03/a-script-for-text-placeholders-in-voodoopad/#comments</comments>
		<pubDate>Wed, 28 Mar 2007 17:59:47 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[mac]]></category>
		<category><![CDATA[scripts]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[VoodooPad]]></category>

		<guid isPermaLink="false">http://michael-mccracken.net/wp/2007/03/28/a-script-for-text-placeholders-in-voodoopad/</guid>
		<description><![CDATA[Last year I wrote about my new page template for VoodooPad. I still use something like it &#8211; I like the uniform look and the built-in navigation starters I get in every page. I got tired of all the clicking around it took to fill in the navigation every time I put in a new [...]]]></description>
			<content:encoded><![CDATA[<p>Last year I wrote about my <a href="http://michael-mccracken.net/wp/?p=39">new page template for VoodooPad</a>. I still use something like it &#8211; I like the uniform look and the built-in navigation starters I get in every page.</p>

<p>I got tired of all the clicking around it took to fill in the navigation every time I put in a new page, so I decided to write a script to mimic XCode&#8217;s &#8220;Select Next Placeholder&#8221; command. In XCode, if you use code completion, you might get something like this:
<code>[dict setObject:&lt;# (id) anObject #&gt; forKey:&lt;# (id)key #&gt;]</code> Then pressing Control-/ cycles the selection through those placeholders so you can replace them with whatever you want quickly.</p>

<p>That&#8217;s really handy for code, and it&#8217;s great for VoodooPad templates too. I wrote the script as a Python script plugin for VoodooPad, and it maps Command-/ to select the next placeholder, wrapping the search at the end just like XCode does. Now my new page template in VoodooPad has a few placeholders in it, and I have a lot fewer pages with default template text sitting in there making me look lazy.</p>

<p>Download it <a href="http://michael-mccracken.net/2007/Select-Next-Placeholder.py">here</a>. (Note, it needs the <a href="http://flyingmeat.com/fs/flystashweb.cgi/40de692c-e33c-01d9-12a1-c0cbe4c4d9e7">VoodooPad Python Plugin Enabler</a> )</p>
]]></content:encoded>
			<wfw:commentRss>http://michael-mccracken.net/2007/03/a-script-for-text-placeholders-in-voodoopad/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

