<?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>langui.sh</title>
	<atom:link href="http://langui.sh/feed/" rel="self" type="application/rss+xml" />
	<link>http://langui.sh</link>
	<description>Fun hacks, WP plugins, photography, and PKI junk.  Languishing since 2008.</description>
	<lastBuildDate>Sat, 19 May 2012 01:42:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="http://superfeedr.com/hubbub"/>		<item>
		<title>Batter&#8217;s Box 1.6</title>
		<link>http://langui.sh/2012/05/18/batters-box-1-6/</link>
		<comments>http://langui.sh/2012/05/18/batters-box-1-6/#comments</comments>
		<pubDate>Sat, 19 May 2012 01:42:40 +0000</pubDate>
		<dc:creator>Paul Kehrer</dc:creator>
				<category><![CDATA[Posts]]></category>

		<guid isPermaLink="false">http://langui.sh/?p=1682</guid>
		<description><![CDATA[After an interesting approval process, 1.6 is now available. There is no 1.5! Grab it now! Changelog Strikes now have a black gradient outline while balls are white in the pitch-by-pitch Pitch speed is now shown at the point of &#8230;<p class="read-more"><a href="http://langui.sh/2012/05/18/batters-box-1-6/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>After an interesting approval process, 1.6 is now available. There is no 1.5! <a href="http://itunes.apple.com/us/app/batters-box/id510063319?mt=8">Grab it</a> now!</p>
<h4>Changelog</h4>
<ul>
<li>Strikes now have a black gradient outline while balls are white in the pitch-by-pitch</li>
<li>Pitch speed is now shown at the point of release rather than when it crosses home plate (matches convention)</li>
<li>Support 4 new pitch types</li>
<li>Pitch popup now shows the count for each pitch in the at bat</li>
<li>Score notifications can now be tapped to take you directly to the game detail</li>
<li>Added stolen base data to the batting stats view for the game</li>
<li>Handle hit by pitch end of atbat</li>
<li>Fixed atbat/ondeck/inhole so it actually shows the player&#8217;s hits properly</li>
<li>Doubleheaders now show up as &#8220;Game 2&#8243; for game time, rather than extremely early in the morning</li>
<li>Various small layout improvements and table striping across more stats tables</li>
<li>Fix case where &#8220;delayed start&#8221; due to rain would not make it rain</li>
<li>Add gradient to mugshots, make mask apply properly when game is postponed</li>
<li>Handle &#8220;inclement weather&#8221; postponement with heavy rain effect</li>
<li>When game is postponed before start time, show &#8220;postponed&#8221; in details view rather than the time</li>
<li>New graphic when pitcher or batter details fail to load or are not yet available</li>
<li>Large scale rewrite of underlying XML parser and various other subsystems</li>
<li>Other code changes that are not user visible</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://langui.sh/2012/05/18/batters-box-1-6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Batter&#8217;s Box 1.4 Released</title>
		<link>http://langui.sh/2012/04/20/batters-box-1-4-released/</link>
		<comments>http://langui.sh/2012/04/20/batters-box-1-4-released/#comments</comments>
		<pubDate>Fri, 20 Apr 2012 22:49:51 +0000</pubDate>
		<dc:creator>Paul Kehrer</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[baseball]]></category>
		<category><![CDATA[ios]]></category>
		<category><![CDATA[ipad]]></category>
		<category><![CDATA[iphone]]></category>

		<guid isPermaLink="false">http://langui.sh/?p=1665</guid>
		<description><![CDATA[Another update to my iOS app Batter&#8217;s Box! Changelog You can now pick up to 3 favorite teams Delayed/postponed games look nicer in the list now (fixes regression from 1.3) Balls/strikes/outs are now more up to date on the game &#8230;<p class="read-more"><a href="http://langui.sh/2012/04/20/batters-box-1-4-released/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>Another update to my iOS app <a href="http://itunes.apple.com/us/app/batters-box/id510063319?mt=8">Batter&#8217;s Box</a>!</p>
<h4>Changelog</h4>
<li>You can now pick up to 3 favorite teams</li>
<li>Delayed/postponed games look nicer in the list now (fixes regression from 1.3)</li>
<li>Balls/strikes/outs are now more up to date on the game details view</li>
<li>Animation now properly restarts on iPhone</li>
<li>Last play now visible on iPhone on game details to provide additional context</li>
<li>Last play now fades in after first play (rather than showing an empty box)</li>
<li>Switch hitters now show opposite the pitcher&#8217;s throwing arm</li>
<li>Fix case where weather animation would stop after leaving and re-entering the app on iPhone</li>
<li>Fixed recap links on iPhone</li>
<li>Replaced day/night backgrounds for iPad with PNGs to stop some banding issues (mostly visible during day/night transitions)</li>
<p>-Miscellaneous small UI fixes (mostly on iPhone)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://langui.sh/2012/04/20/batters-box-1-4-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby OpenSSL::X509::Name#to_a Followup</title>
		<link>http://langui.sh/2012/04/16/ruby-opensslx509nameto_a-followup/</link>
		<comments>http://langui.sh/2012/04/16/ruby-opensslx509nameto_a-followup/#comments</comments>
		<pubDate>Tue, 17 Apr 2012 04:02:23 +0000</pubDate>
		<dc:creator>Paul Kehrer</dc:creator>
				<category><![CDATA[Posts]]></category>

		<guid isPermaLink="false">http://langui.sh/?p=1660</guid>
		<description><![CDATA[Awhile back I talked about an issue (and workaround) regarding how Name#to_a worked in Ruby 1.9.3p0 and earlier. I&#8217;m happy to report that my patch was accepted (and rewritten by core devs to be better!) and subsequently backported to Ruby &#8230;<p class="read-more"><a href="http://langui.sh/2012/04/16/ruby-opensslx509nameto_a-followup/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>Awhile back I <a href="/2011/12/21/ruby-opensslx509nameto_a-dissection/">talked about an issue</a> (and workaround) regarding how Name#to_a worked in Ruby 1.9.3p0 and earlier. I&#8217;m happy to report that my <a href="http://bugs.ruby-lang.org/issues/5787">patch</a> was accepted (and rewritten by core devs to be better!) and subsequently <a href="http://bugs.ruby-lang.org/issues/5983">backported</a> to Ruby 1.9.3. That fix was released as part of the 1.9.3-p125 release in February. Pretty quick turnaround!</p>
]]></content:encoded>
			<wfw:commentRss>http://langui.sh/2012/04/16/ruby-opensslx509nameto_a-followup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Batter&#8217;s Box 1.3 Released</title>
		<link>http://langui.sh/2012/04/13/batters-box-1-3-released/</link>
		<comments>http://langui.sh/2012/04/13/batters-box-1-3-released/#comments</comments>
		<pubDate>Fri, 13 Apr 2012 16:52:59 +0000</pubDate>
		<dc:creator>Paul Kehrer</dc:creator>
				<category><![CDATA[Posts]]></category>

		<guid isPermaLink="false">http://langui.sh/?p=1652</guid>
		<description><![CDATA[Apple approved Batter&#8217;s Box 1.3 last night. The biggest single change is that the iPhone details view now has all the same graphics as the iPad version. Here&#8217;s a screenshot: You can also see more screenshots here. Complete Changelog iPhone &#8230;<p class="read-more"><a href="http://langui.sh/2012/04/13/batters-box-1-3-released/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>Apple approved <a href="http://itunes.apple.com/us/app/batters-box/id510063319?ls=1&#038;mt=8">Batter&#8217;s Box</a> 1.3 last night. The biggest single change is that the iPhone details view now has all the same graphics as the iPad version. Here&#8217;s a screenshot:<br />
<a href="http://cdn.langui.sh/2012/04/photo-2.png"><img class="aligncenter size-medium wp-image-1572" title="bb5" src="http://cdn.langui.sh/2012/04/photo-2-200x300.png" alt="" width="200" height="300" /></a></p>
<p>You can also see more screenshots <a href="/batters-box">here</a>.</p>
<h3>Complete Changelog</h3>
<ul>
<li>iPhone now has the same view as the iPad on the detail page. Including weather, day/night, and fireworks.</li>
<li>iPhone now shows tv/radio station information prior to game when you tap a game.</li>
<li>Preview link now shows on the game list for each game before first pitch</li>
<li>Last play always shows for in progress games on iPad (+some animations)</li>
<li>Walks are now properly recognized as the end of an at bat (probably still have bugs with wild pitch reach base or other obscure situations)</li>
<li>Fix rain animation so it triggers properly when a rain delay occurs (iPad)</li>
<li>Preview link text no longer gets truncated</li>
<li>Animate batter when switching between L/R hitters</li>
<li>Handle &#8220;Dome&#8221; weather condition</li>
<li>Fix case where AT&#038;T Park was rendered as AT&amp;T Park</li>
<li>Nicer loading spinner for highlights view</li>
<li>The data webview on the game details page now maintains scroll position across reloads</li>
<li>Reload timers now disable when you leave the app and re-enable when you foreground it. Any loads in progress is canceled when going to background.</li>
<li>Better handling of long idle times in the background</li>
<li>Reworked underlying logic for games view controller. The 3 game cell layouts are now separate prototypes and classes now to improve code readability</li>
</ul>
<p>I&#8217;ll be submitting 1.4 to Apple shortly with another batch of new features (and a few bug fixes for small visual issues that are present in the 1.3 build). Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://langui.sh/2012/04/13/batters-box-1-3-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Batter&#8217;s Box Released!</title>
		<link>http://langui.sh/2012/04/03/batters-box-released/</link>
		<comments>http://langui.sh/2012/04/03/batters-box-released/#comments</comments>
		<pubDate>Tue, 03 Apr 2012 20:44:02 +0000</pubDate>
		<dc:creator>Paul Kehrer</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[baseball]]></category>
		<category><![CDATA[ios]]></category>
		<category><![CDATA[ipad]]></category>
		<category><![CDATA[iphone]]></category>

		<guid isPermaLink="false">http://langui.sh/?p=1571</guid>
		<description><![CDATA[Batter&#8217;s Box (universal, iPhone and iPad), my side project for the past month or so, has been released! It&#8217;s a baseball score and stat tracking app; check out the app&#8217;s home page for features, screenshots, and more.]]></description>
			<content:encoded><![CDATA[<p><img src="http://cdn.langui.sh/2012/03/icon-512-150x150.png" alt="" title="icon-512" width="150" height="150" class="alignright size-thumbnail wp-image-1616" /><a href="http://itunes.apple.com/us/app/batters-box/id510063319?ls=1&#038;mt=8">Batter&#8217;s Box</a> (universal, iPhone and iPad), my side project for the past month or so, has been released! It&#8217;s a baseball score and stat tracking app; check out the app&#8217;s <a href="/batters-box">home page</a> for features, screenshots, and more.</p>
]]></content:encoded>
			<wfw:commentRss>http://langui.sh/2012/04/03/batters-box-released/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>r509 v0.6</title>
		<link>http://langui.sh/2012/01/17/r509-v0-6/</link>
		<comments>http://langui.sh/2012/01/17/r509-v0-6/#comments</comments>
		<pubDate>Tue, 17 Jan 2012 20:23:53 +0000</pubDate>
		<dc:creator>Paul Kehrer</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[r509]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[x509]]></category>

		<guid isPermaLink="false">http://langui.sh/?p=1567</guid>
		<description><![CDATA[r509 v0.6 is out. There were 39 commits encompassing the following changes from 0.5 to 0.6. * Gemfile updated to set proper versions of supporting gems for doc generation * Fixes to load_yaml in Config * OCSP handling extensively refactored &#8230;<p class="read-more"><a href="http://langui.sh/2012/01/17/r509-v0-6/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p><a href="http://r509.org">r509</a> v0.6 is out. There were 39 commits encompassing the following changes from 0.5 to 0.6.</p>
<p>* Gemfile updated to set proper versions of supporting gems for doc generation<br />
* Fixes to load_yaml in Config<br />
* OCSP handling extensively refactored and most of the logic moved into the <a href="https://github.com/reaperhulk/r509-ocsp-responder">r509 OCSP responder</a> project.<br />
* Cert#subject_component no longer improperly upcases elements<br />
* SAN is now supported in self-signed certificates<br />
* Cert#san_names returns an empty array if no san_names exist<br />
* Cert#fingerprint is now an available method<br />
* Cert#subject_names returns a concatenation (de-duped) of CN and SANs<br />
* General refactoring in several areas to improve code quality<br />
* Csr now takes :san_names in constructor instead of :domains. This is more consistent<br />
* Files renamed to lowercase to match Ruby conventions<br />
* Cert#in_validity_range? method added<br />
* Fixed some order dependent tests</p>
<p>The majority of work went into improving the OCSP codebase, which was moved into the r509-ocsp-responder project, but that&#8217;s a subject for another blog entry!</p>
]]></content:encoded>
			<wfw:commentRss>http://langui.sh/2012/01/17/r509-v0-6/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>r509 v0.5</title>
		<link>http://langui.sh/2011/12/27/r509-v0-5/</link>
		<comments>http://langui.sh/2011/12/27/r509-v0-5/#comments</comments>
		<pubDate>Wed, 28 Dec 2011 04:01:50 +0000</pubDate>
		<dc:creator>Paul Kehrer</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[openssl]]></category>
		<category><![CDATA[r509]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://langui.sh/?p=1542</guid>
		<description><![CDATA[I haven&#8217;t talked about r509 here in awhile, but since v0.5 just got tagged I thought I&#8217;d plug it again. r509 is a wrapper for the OpenSSL libraries in Ruby. It&#8217;s designed to allow you to do a wide variety &#8230;<p class="read-more"><a href="http://langui.sh/2011/12/27/r509-v0-5/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>I haven&#8217;t talked about <a href="http://r509.org">r509</a> here in awhile, but since v0.5 just got tagged I thought I&#8217;d plug it again. r509 is a wrapper for the OpenSSL libraries in Ruby. It&#8217;s designed to allow you to do a wide variety of certificate authority related operations (issuance, revocation, CRL generation, OCSP responses, et cetera). There are also some ancillary gems that are under active development (<a href="https://github.com/sirsean/r509-ca-http">r509-ca-http</a>, <a href="https://github.com/reaperhulk/r509-ocsp-responder">r509-ocsp-responder</a>, <a href="https://github.com/sirsean/r509-validity-redis">r509-validity-redis</a>) which will gain more documentation as these projects progress.</p>
<p>Check it out, file issues, fork, and contribute!</p>
]]></content:encoded>
			<wfw:commentRss>http://langui.sh/2011/12/27/r509-v0-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby OpenSSL::X509::Name#to_a Dissection</title>
		<link>http://langui.sh/2011/12/21/ruby-opensslx509nameto_a-dissection/</link>
		<comments>http://langui.sh/2011/12/21/ruby-opensslx509nameto_a-dissection/#comments</comments>
		<pubDate>Wed, 21 Dec 2011 21:54:31 +0000</pubDate>
		<dc:creator>Paul Kehrer</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[openssl]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://langui.sh/?p=1559</guid>
		<description><![CDATA[Over at Viking Hammer my coworker Sean Schulte has written up a great article dissecting an issue we ran into regarding the way Ruby&#8217;s OpenSSL::X509::Name#to_a currently builds its array. He discusses the problem, the two solutions we came up with, &#8230;<p class="read-more"><a href="http://langui.sh/2011/12/21/ruby-opensslx509nameto_a-dissection/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>Over at <a href="http://vikinghammer.com">Viking Hammer</a> my coworker Sean Schulte has written up a <a href="http://vikinghammer.com/2011/12/21/ruby-opensslx509name-throws-away-unknown-subject-component-names/">great article</a> dissecting an issue we ran into regarding the way Ruby&#8217;s OpenSSL::X509::Name#to_a currently builds its array. He discusses the problem, the two solutions we came up with, and shares code examples. Go check it out!</p>
]]></content:encoded>
			<wfw:commentRss>http://langui.sh/2011/12/21/ruby-opensslx509nameto_a-dissection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Git Hooks For Pre-Commit Rspec Testing</title>
		<link>http://langui.sh/2011/12/19/git-hooks-for-pre-commit-rspec-testing/</link>
		<comments>http://langui.sh/2011/12/19/git-hooks-for-pre-commit-rspec-testing/#comments</comments>
		<pubDate>Tue, 20 Dec 2011 03:12:12 +0000</pubDate>
		<dc:creator>Paul Kehrer</dc:creator>
				<category><![CDATA[Posts]]></category>

		<guid isPermaLink="false">http://langui.sh/?p=1554</guid>
		<description><![CDATA[Here&#8217;s a pair of scripts for automatically running Ruby rspec tests, refusing to commit if they fail, and pulling in the results into the commit msg. If you want to use them place them in your project&#8217;s .git/hooks directory as &#8230;<p class="read-more"><a href="http://langui.sh/2011/12/19/git-hooks-for-pre-commit-rspec-testing/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a pair of scripts for automatically running Ruby rspec tests, refusing to commit if they fail, and pulling in the results into the commit msg. If you want to use them place them in your project&#8217;s .git/hooks directory as executable scripts.</p>
<p>These scripts assume you have rspec writing to rspec_results.html. To do this by default add a .rspec file in your project dir with &#8220;-f doc -f h -o rspec_results.html&#8221; inside.</p>
<p>pre-commit</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;">#!/usr/bin/env ruby</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'pty'</span>
html_path = <span style="color:#996600;">&quot;rspec_results.html&quot;</span>  
<span style="color:#008000; font-style:italic;">#PTY.spawn trick from</span>
<span style="color:#008000; font-style:italic;">#http://stackoverflow.com/questions/1154846/continuously-read-from-stdout-of-external-process-in-ruby</span>
<span style="color:#9966CC; font-weight:bold;">begin</span>
	PTY.<span style="color:#9900CC;">spawn</span><span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#996600;">&quot;rake spec&quot;</span> <span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>stdin, stdout, pid<span style="color:#006600; font-weight:bold;">|</span>
	<span style="color:#9966CC; font-weight:bold;">begin</span>
		stdin.<span style="color:#9900CC;">each</span> <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#006600; font-weight:bold;">|</span>line<span style="color:#006600; font-weight:bold;">|</span> <span style="color:#CC0066; font-weight:bold;">print</span> line <span style="color:#006600; font-weight:bold;">&#125;</span>
	<span style="color:#9966CC; font-weight:bold;">rescue</span> <span style="color:#CC00FF; font-weight:bold;">Errno</span>::EIO
		<span style="color:#9966CC; font-weight:bold;">end</span>
	<span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">rescue</span> <span style="color:#6666ff; font-weight:bold;">PTY::ChildExited</span>
	<span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;The child process exited!&quot;</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#008000; font-style:italic;"># find out how many errors were found  </span>
html = <span style="color:#CC0066; font-weight:bold;">open</span><span style="color:#006600; font-weight:bold;">&#40;</span>html_path<span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">read</span>  
examples = html.<span style="color:#9900CC;">match</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">/</span><span style="color:#006600; font-weight:bold;">&#40;</span>\d<span style="color:#006600; font-weight:bold;">+</span><span style="color:#006600; font-weight:bold;">&#41;</span> examples<span style="color:#006600; font-weight:bold;">/</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">to_i</span> <span style="color:#9966CC; font-weight:bold;">rescue</span> <span style="color:#006666;">0</span>  
failures = html.<span style="color:#9900CC;">match</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">/</span><span style="color:#006600; font-weight:bold;">&#40;</span>\d<span style="color:#006600; font-weight:bold;">+</span><span style="color:#006600; font-weight:bold;">&#41;</span> failures<span style="color:#006600; font-weight:bold;">/</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">to_i</span> <span style="color:#9966CC; font-weight:bold;">rescue</span> <span style="color:#006666;">0</span>  
<span style="color:#9966CC; font-weight:bold;">if</span> failures == <span style="color:#006666;">0</span> <span style="color:#9966CC; font-weight:bold;">then</span>
	failures = html.<span style="color:#9900CC;">match</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">/</span><span style="color:#006600; font-weight:bold;">&#40;</span>\d<span style="color:#006600; font-weight:bold;">+</span><span style="color:#006600; font-weight:bold;">&#41;</span> failure<span style="color:#006600; font-weight:bold;">/</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">to_i</span> <span style="color:#9966CC; font-weight:bold;">rescue</span> <span style="color:#006666;">0</span>  
<span style="color:#9966CC; font-weight:bold;">end</span>
pending = html.<span style="color:#9900CC;">match</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">/</span><span style="color:#006600; font-weight:bold;">&#40;</span>\d<span style="color:#006600; font-weight:bold;">+</span><span style="color:#006600; font-weight:bold;">&#41;</span> pending<span style="color:#006600; font-weight:bold;">/</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">to_i</span> <span style="color:#9966CC; font-weight:bold;">rescue</span> <span style="color:#006666;">0</span>  
&nbsp;
<span style="color:#9966CC; font-weight:bold;">if</span> failures.<span style="color:#9900CC;">zero</span>?  
  <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;0 failed! #{examples} run, #{pending} pending&quot;</span>  
  <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;View rspec results at #{File.expand_path(html_path)}&quot;</span>  
  <span style="color:#CC0066; font-weight:bold;">sleep</span> <span style="color:#006666;">1</span>
  <span style="color:#CC0066; font-weight:bold;">exit</span> <span style="color:#006666;">0</span>
<span style="color:#9966CC; font-weight:bold;">else</span>  
  <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;<span style="color:#000099;">\a</span>DID NOT COMMIT YOUR FILES!&quot;</span>  
  <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;View rspec results at #{File.expand_path(html_path)}&quot;</span>  
  <span style="color:#CC0066; font-weight:bold;">puts</span>  
  <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;#{failures} failed! #{examples} run, #{pending} pending&quot;</span>  
  <span style="color:#996600;">`open #{html_path}`</span>
  <span style="color:#CC0066; font-weight:bold;">exit</span> <span style="color:#006666;">1</span>  
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>prepare-commit-msg</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;">#!/usr/bin/env ruby</span>
html_path = <span style="color:#996600;">&quot;rspec_results.html&quot;</span>
<span style="color:#008000; font-style:italic;"># find out how many errors were found  </span>
html = <span style="color:#CC0066; font-weight:bold;">open</span><span style="color:#006600; font-weight:bold;">&#40;</span>html_path<span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">read</span>
examples = html.<span style="color:#9900CC;">match</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">/</span><span style="color:#006600; font-weight:bold;">&#40;</span>\d<span style="color:#006600; font-weight:bold;">+</span><span style="color:#006600; font-weight:bold;">&#41;</span> examples<span style="color:#006600; font-weight:bold;">/</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">to_i</span> <span style="color:#9966CC; font-weight:bold;">rescue</span> <span style="color:#006666;">0</span>
failures = html.<span style="color:#9900CC;">match</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">/</span><span style="color:#006600; font-weight:bold;">&#40;</span>\d<span style="color:#006600; font-weight:bold;">+</span><span style="color:#006600; font-weight:bold;">&#41;</span> failures<span style="color:#006600; font-weight:bold;">/</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">to_i</span> <span style="color:#9966CC; font-weight:bold;">rescue</span> <span style="color:#006666;">0</span>
<span style="color:#9966CC; font-weight:bold;">if</span> failures == <span style="color:#006666;">0</span> <span style="color:#9966CC; font-weight:bold;">then</span>
        failures = html.<span style="color:#9900CC;">match</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">/</span><span style="color:#006600; font-weight:bold;">&#40;</span>\d<span style="color:#006600; font-weight:bold;">+</span><span style="color:#006600; font-weight:bold;">&#41;</span> failure<span style="color:#006600; font-weight:bold;">/</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">to_i</span> <span style="color:#9966CC; font-weight:bold;">rescue</span> <span style="color:#006666;">0</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
pending = html.<span style="color:#9900CC;">match</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">/</span><span style="color:#006600; font-weight:bold;">&#40;</span>\d<span style="color:#006600; font-weight:bold;">+</span><span style="color:#006600; font-weight:bold;">&#41;</span> pending<span style="color:#006600; font-weight:bold;">/</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">to_i</span> <span style="color:#9966CC; font-weight:bold;">rescue</span> <span style="color:#006666;">0</span>
&nbsp;
&nbsp;
message_file = ARGV<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span>
message = <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">read</span><span style="color:#006600; font-weight:bold;">&#40;</span>message_file<span style="color:#006600; font-weight:bold;">&#41;</span>
index = message.<span style="color:#9900CC;">index</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'# Please enter the commit message for your changes. Lines starting'</span><span style="color:#006600; font-weight:bold;">&#41;</span>
message.<span style="color:#9900CC;">insert</span><span style="color:#006600; font-weight:bold;">&#40;</span>index<span style="color:#006600; font-weight:bold;">-</span><span style="color:#006666;">1</span>, <span style="color:#996600;">&quot;<span style="color:#000099;">\n</span><span style="color:#000099;">\n</span>#{failures} failed! #{examples} run, #{pending} pending&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#CC0066; font-weight:bold;">open</span><span style="color:#006600; font-weight:bold;">&#40;</span>message_file,<span style="color:#996600;">'w'</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#006600; font-weight:bold;">|</span>f<span style="color:#006600; font-weight:bold;">|</span>
        f.<span style="color:#CC0066; font-weight:bold;">puts</span><span style="color:#006600; font-weight:bold;">&#40;</span>message<span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#006600; font-weight:bold;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://langui.sh/2011/12/19/git-hooks-for-pre-commit-rspec-testing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Growl For turntable.fm</title>
		<link>http://langui.sh/2011/12/14/growl-for-turntable-fm/</link>
		<comments>http://langui.sh/2011/12/14/growl-for-turntable-fm/#comments</comments>
		<pubDate>Thu, 15 Dec 2011 01:54:35 +0000</pubDate>
		<dc:creator>Paul Kehrer</dc:creator>
				<category><![CDATA[Posts]]></category>

		<guid isPermaLink="false">http://langui.sh/?p=1545</guid>
		<description><![CDATA[turntable.fm is a fun place to discover new music and play it for your friends, but it&#8217;s frustrating to use at work since you have to switch to the tab to see what song is playing and who&#8217;s saying what. &#8230;<p class="read-more"><a href="http://langui.sh/2011/12/14/growl-for-turntable-fm/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>turntable.fm is a fun place to discover new music and play it for your friends, but it&#8217;s frustrating to use at work since you have to switch to the tab to see what song is playing and who&#8217;s saying what. I wrote a <a href="http://fluidapp.com">Fluid</a> userscript that you can use to growl songs and chat lines to solve this problem. It also prevents idle timeouts from occuring in turntable if you don&#8217;t interact with it for awhile.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> debug <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> sendChat <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
&nbsp;
logger<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'loading userscript'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> bindDOM<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    logger<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'binding'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.messages'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'DOMNodeInserted'</span><span style="color: #339933;">,</span>parseChat<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    $<span style="color: #009900;">&#40;</span>window<span style="color: #009900;">&#41;</span>.<span style="color: #000066;">blur</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        sendChat <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    $<span style="color: #009900;">&#40;</span>window<span style="color: #009900;">&#41;</span>.<span style="color: #000066;">focus</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        sendChat <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> parseChat<span style="color: #009900;">&#40;</span>event<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #003366; font-weight: bold;">var</span> message <span style="color: #339933;">=</span> event.<span style="color: #660066;">target</span><span style="color: #339933;">;</span>
    <span style="color: #003366; font-weight: bold;">var</span> author <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span>message<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">find</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.speaker'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #003366; font-weight: bold;">var</span> body <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span>message<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">find</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.text'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>body.<span style="color: #660066;">indexOf</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'started playing'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #003366; font-weight: bold;">var</span> artist <span style="color: #339933;">=</span> body.<span style="color: #660066;">match</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/by (.*)/</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
        <span style="color: #003366; font-weight: bold;">var</span> song <span style="color: #339933;">=</span> body.<span style="color: #660066;">match</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/&quot;(.+)&quot;/</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
        logger<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'growling now'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        logger<span style="color: #009900;">&#40;</span>artist<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        logger<span style="color: #009900;">&#40;</span>song<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        showGrowl<span style="color: #009900;">&#40;</span>artist<span style="color: #339933;">,</span>song<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
        body <span style="color: #339933;">=</span> body.<span style="color: #660066;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>sendChat<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            showGrowl<span style="color: #009900;">&#40;</span>author<span style="color: #339933;">,</span>body<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> showGrowl<span style="color: #009900;">&#40;</span>title<span style="color: #339933;">,</span>description<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    window.<span style="color: #660066;">fluid</span>.<span style="color: #660066;">showGrowlNotification</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
        title<span style="color: #339933;">:</span> title<span style="color: #339933;">,</span> 
        description<span style="color: #339933;">:</span> description<span style="color: #339933;">,</span> 
        priority<span style="color: #339933;">:</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">,</span> 
        sticky<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">,</span>
        identifier<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;sh.langui.turntable&quot;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> idlePreventer<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    logger<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'invoking idle preventer'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.addSongsButton'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.cancelButton'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> logger<span style="color: #009900;">&#40;</span>data<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>debug<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        console.<span style="color: #660066;">log</span><span style="color: #009900;">&#40;</span>data<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
setTimeout<span style="color: #009900;">&#40;</span>bindDOM<span style="color: #339933;">,</span><span style="color: #CC0000;">5000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
setInterval<span style="color: #009900;">&#40;</span>idlePreventer<span style="color: #339933;">,</span><span style="color: #CC0000;">300000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>You&#8217;ll need a licensed version of Fluid to use this userscript.</p>
]]></content:encoded>
			<wfw:commentRss>http://langui.sh/2011/12/14/growl-for-turntable-fm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using memcached
Page Caching using memcached
Database Caching 16/40 queries in 0.013 seconds using memcached
Object Caching 971/1009 objects using memcached

Served from: langui.sh @ 2012-05-21 12:03:32 -->
