<?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>Otaqui.Com &#187; Professional</title>
	<atom:link href="http://otaqui.com/blog/category/professional/feed/" rel="self" type="application/rss+xml" />
	<link>http://otaqui.com/blog</link>
	<description>Pete Otaqui's blog about web development and everything else</description>
	<lastBuildDate>Tue, 31 Jan 2012 23:23:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Multiple jQuery instances can&#8217;t unbind each others events</title>
		<link>http://otaqui.com/blog/1115/multiple-jquery-instances-cant-unbind-each-others-events/</link>
		<comments>http://otaqui.com/blog/1115/multiple-jquery-instances-cant-unbind-each-others-events/#comments</comments>
		<pubDate>Thu, 06 Oct 2011 10:56:05 +0000</pubDate>
		<dc:creator>pete</dc:creator>
				<category><![CDATA[Professional]]></category>

		<guid isPermaLink="false">http://otaqui.com/blog/?p=1115</guid>
		<description><![CDATA[If you have multiple versions (or indeed instances of the same version) of jQuery on a page, you may end up with the problem of not being able to unbind events between them. Here&#8217;s an example:]]></description>
			<content:encoded><![CDATA[<p>If you have multiple versions (or indeed instances of the same version) of jQuery on a page, you may end up with the problem of not being able to unbind events between them.</p>
<p>Here&#8217;s an example:</p>
<script>document.write('<link rel="stylesheet" href="https://gist.github.com/stylesheets/gist/embed.css"/>')

document.write('<div id=\"gist-1267113\" class=\"gist\">\n\n        <div class=\"gist-file\">\n          <div class=\"gist-data gist-syntax\">\n              <div class=\"gist-highlight\"><pre><div class=\'line\' id=\'LC1\'><span class=\"cp\">&lt;!DOCTYPE html&gt;<\/span><\/div><div class=\'line\' id=\'LC2\'><span class=\"nt\">&lt;html&gt;<\/span><\/div><div class=\'line\' id=\'LC3\'>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"nt\">&lt;head&gt;<\/span><\/div><div class=\'line\' id=\'LC4\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"nt\">&lt;title&gt;<\/span>Multiple jQuery Hell<span class=\"nt\">&lt;/title&gt;<\/span><\/div><div class=\'line\' id=\'LC5\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"nt\">&lt;script <\/span><span class=\"na\">src=<\/span><span class=\"s\">&quot;jquery-1.6.3.min.js&quot;<\/span><span class=\"nt\">&gt;&lt;/script&gt;<\/span><\/div><div class=\'line\' id=\'LC6\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"nt\">&lt;script&gt;<\/span><\/div><div class=\'line\' id=\'LC7\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"c1\">// keep a reference to jQuery 1.6.3, and clear the name from the global scope<\/span><\/div><div class=\'line\' id=\'LC8\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"nx\">jQuery163<\/span> <span class=\"o\">=<\/span> <span class=\"nx\">jQuery<\/span><span class=\"p\">;<\/span><\/div><div class=\'line\' id=\'LC9\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"nx\">jQuery<\/span><span class=\"p\">.<\/span><span class=\"nx\">noConflict<\/span><span class=\"p\">(<\/span><span class=\"kc\">true<\/span><span class=\"p\">);<\/span><\/div><div class=\'line\' id=\'LC10\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"nt\">&lt;/script&gt;<\/span><\/div><div class=\'line\' id=\'LC11\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"nt\">&lt;script <\/span><span class=\"na\">src=<\/span><span class=\"s\">&quot;jquery-1.6.4.min.js&quot;<\/span><span class=\"nt\">&gt;&lt;/script&gt;<\/span><\/div><div class=\'line\' id=\'LC12\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"nt\">&lt;script&gt;<\/span><\/div><div class=\'line\' id=\'LC13\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"c1\">// keep a reference to jQuery 1.6.4, and clear the name from the global scope<\/span><\/div><div class=\'line\' id=\'LC14\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"nx\">jQuery164<\/span> <span class=\"o\">=<\/span> <span class=\"nx\">jQuery<\/span><span class=\"p\">;<\/span><\/div><div class=\'line\' id=\'LC15\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"nx\">jQuery<\/span><span class=\"p\">.<\/span><span class=\"nx\">noConflict<\/span><span class=\"p\">(<\/span><span class=\"kc\">true<\/span><span class=\"p\">);<\/span><\/div><div class=\'line\' id=\'LC16\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"nt\">&lt;/script&gt;<\/span><\/div><div class=\'line\' id=\'LC17\'><br/><\/div><div class=\'line\' id=\'LC18\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"nt\">&lt;script&gt;<\/span><\/div><div class=\'line\' id=\'LC19\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"c1\">// check that we have two distinct jQueries<\/span><\/div><div class=\'line\' id=\'LC20\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"nx\">console<\/span><span class=\"p\">.<\/span><span class=\"nx\">log<\/span><span class=\"p\">(<\/span><span class=\"nx\">jQuery163<\/span><span class=\"p\">().<\/span><span class=\"nx\">jquery<\/span><span class=\"p\">);<\/span> <span class=\"c1\">// 1.6.3<\/span><\/div><div class=\'line\' id=\'LC21\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"nx\">console<\/span><span class=\"p\">.<\/span><span class=\"nx\">log<\/span><span class=\"p\">(<\/span><span class=\"nx\">jQuery164<\/span><span class=\"p\">().<\/span><span class=\"nx\">jquery<\/span><span class=\"p\">);<\/span> <span class=\"c1\">// 1.6.4<\/span><\/div><div class=\'line\' id=\'LC22\'><br/><\/div><div class=\'line\' id=\'LC23\'><br/><\/div><div class=\'line\' id=\'LC24\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"c1\">// we could use either for the onDomReady bit ...<\/span><\/div><div class=\'line\' id=\'LC25\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"nx\">jQuery163<\/span><span class=\"p\">(<\/span><span class=\"kd\">function<\/span><span class=\"p\">()<\/span> <span class=\"p\">{<\/span><\/div><div class=\'line\' id=\'LC26\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"c1\">// bind a click event callback<\/span><\/div><div class=\'line\' id=\'LC27\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"nx\">jQuery163<\/span><span class=\"p\">(<\/span><span class=\"s1\">&#39;a&#39;<\/span><span class=\"p\">).<\/span><span class=\"nx\">bind<\/span><span class=\"p\">(<\/span><span class=\"s1\">&#39;click&#39;<\/span><span class=\"p\">,<\/span> <span class=\"kd\">function<\/span><span class=\"p\">()<\/span> <span class=\"p\">{<\/span><\/div><div class=\'line\' id=\'LC28\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"nx\">console<\/span><span class=\"p\">.<\/span><span class=\"nx\">log<\/span><span class=\"p\">(<\/span><span class=\"s1\">&#39;clicky!&#39;<\/span><span class=\"p\">);<\/span><\/div><div class=\'line\' id=\'LC29\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"p\">});<\/span><\/div><div class=\'line\' id=\'LC30\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"c1\">// now try and unbind it<\/span><\/div><div class=\'line\' id=\'LC31\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"nx\">jQuery164<\/span><span class=\"p\">(<\/span><span class=\"s1\">&#39;a&#39;<\/span><span class=\"p\">).<\/span><span class=\"nx\">unbind<\/span><span class=\"p\">(<\/span><span class=\"s1\">&#39;click&#39;<\/span><span class=\"p\">);<\/span> <span class=\"c1\">// this doesn&#39;t unbind the click event callback<\/span><\/div><div class=\'line\' id=\'LC32\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"p\">});<\/span><\/div><div class=\'line\' id=\'LC33\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"nt\">&lt;/script&gt;<\/span><\/div><div class=\'line\' id=\'LC34\'>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"nt\">&lt;/head&gt;<\/span><\/div><div class=\'line\' id=\'LC35\'><br/><\/div><div class=\'line\' id=\'LC36\'>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"nt\">&lt;body&gt;<\/span><\/div><div class=\'line\' id=\'LC37\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"nt\">&lt;h1&gt;<\/span>Multiple jQuery Hell<span class=\"nt\">&lt;/h1&gt;<\/span><\/div><div class=\'line\' id=\'LC38\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"nt\">&lt;a<\/span> <span class=\"na\">href=<\/span><span class=\"s\">&quot;#&quot;<\/span><span class=\"nt\">&gt;<\/span>Clicky<span class=\"nt\">&lt;/a&gt;<\/span><\/div><div class=\'line\' id=\'LC39\'>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"nt\">&lt;/body&gt;<\/span><\/div><div class=\'line\' id=\'LC40\'><span class=\"nt\">&lt;/html&gt;<\/span><\/div><div class=\'line\' id=\'LC41\'><br/><\/div><\/pre><\/div>\n          <\/div>\n\n          <div class=\"gist-meta\">\n            <a href=\"https://gist.github.com/raw/1267113/8d9e58d2020e2c02ecee46b7797f7996f6e495f8/multiple_jquery_hell.html\" style=\"float:right;\">view raw<\/a>\n            <a href=\"https://gist.github.com/1267113#file_multiple_jquery_hell.html\" style=\"float:right;margin-right:10px;color:#666\">multiple_jquery_hell.html<\/a>\n            <a href=\"https://gist.github.com/1267113\">This Gist<\/a> brought to you by <a href=\"http://wordpress.org/extend/plugins/github-gist/\">GitHub Gist WordPress Plugin<\/a>.\n          <\/div>\n        <\/div>\n<\/div>\n')
</script><div style='margin-bottom:1em;padding:0;'><noscript><code><pre style='overflow:auto;margin:0;padding:0;border:1px solid #DDD;'>&lt;html&gt;&lt;body&gt;You are being &lt;a href=&quot;https://raw.github.com/gist/1267113/multiple_jquery_hell.html&quot;&gt;redirected&lt;/a&gt;.&lt;/body&gt;&lt;/html&gt;</pre></code></noscript></div>
]]></content:encoded>
			<wfw:commentRss>http://otaqui.com/blog/1115/multiple-jquery-instances-cant-unbind-each-others-events/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Stop console.log causing errors in IE6 and other browsers</title>
		<link>http://otaqui.com/blog/1079/stop-console-log-causing-errors-in-ie6-and-other-browsers/</link>
		<comments>http://otaqui.com/blog/1079/stop-console-log-causing-errors-in-ie6-and-other-browsers/#comments</comments>
		<pubDate>Thu, 22 Sep 2011 09:13:26 +0000</pubDate>
		<dc:creator>pete</dc:creator>
				<category><![CDATA[Professional]]></category>

		<guid isPermaLink="false">http://otaqui.com/blog/?p=1079</guid>
		<description><![CDATA[You know what it&#8217;s like &#8230; you leave a console.log buried somewhere in your code, and the error that causes in IE stops your javascript from running. Well, this little snippet will create a fake copy of the Firebug API if it can&#8217;t find a window.console.]]></description>
			<content:encoded><![CDATA[<p>You know what it&#8217;s like &#8230; you leave a console.log buried somewhere in your code, and the error that causes in IE stops your javascript from running.  Well, this little snippet will create a fake copy of the Firebug API if it can&#8217;t find a window.console.</p>
<script><!DOCTYPE html>
<html>
  <head>
    <meta charset='utf-8'>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <title>Server Error - GitHub</title>
    <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub" />
    <link rel="fluid-icon" href="https://github.com/fluidicon.png" title="GitHub" />

    
    

    

    <link href="https://a248.e.akamai.net/assets.github.com/stylesheets/bundles/github-b2f1a489306869be71fbf48340d88897ad6eab90.css" media="screen" rel="stylesheet" type="text/css" />
    <link href="https://a248.e.akamai.net/assets.github.com/stylesheets/bundles/github2-31179266d1c38c5dd1d8d490d71c4b0e0fbbefd7.css" media="screen" rel="stylesheet" type="text/css" />
    

    <script src="https://a248.e.akamai.net/assets.github.com/javascripts/bundles/jquery-e46225f266eba00902b2e5b66fe6fe6a484fb242.js" type="text/javascript"></script>
    <script src="https://a248.e.akamai.net/assets.github.com/javascripts/bundles/github-6590aad9abc6772c265d53b5038cc2ccb3d2893f.js" type="text/javascript"></script>
    

    
  </head>


  <body class="logged_out    env-production ">
    


    

      <div id="header" class="true clearfix">
        <div class="container clearfix">
          <a class="site-logo" href="https://github.com">
            <!--[if IE]>
            <img alt="GitHub" class="github-logo" src="https://a248.e.akamai.net/assets.github.com/images/modules/header/logov7.png?1323882804" />
            <img alt="GitHub" class="github-logo-hover" src="https://a248.e.akamai.net/assets.github.com/images/modules/header/logov7-hover.png?1324325453" />
            <![endif]-->
            <img alt="GitHub" class="github-logo-4x" height="30" src="https://a248.e.akamai.net/assets.github.com/images/modules/header/logov7@4x.png?1323882804" />
            <img alt="GitHub" class="github-logo-4x-hover" height="30" src="https://a248.e.akamai.net/assets.github.com/images/modules/header/logov7@4x-hover.png?1324325453" />
          </a>

                  <!--
      make sure to use fully qualified URLs here since this nav
      is used on error pages on other domains
    -->
    <ul class="top-nav logged_out">
        <li class="pricing"><a href="https://github.com/plans">Signup and Pricing</a></li>
        <li class="explore"><a href="https://github.com/explore">Explore GitHub</a></li>
      <li class="features"><a href="https://github.com/features">Features</a></li>
        <li class="blog"><a href="https://github.com/blog">Blog</a></li>
      <li class="login"><a href="https://github.com/login">Login</a></li>
    </ul>



          
        </div>
      </div>

      

        <div class="site clearfix">
          <div class="container">
            
<div id="errornew" class="standard">
  <img alt="Unicorn is angry" height="205" src="https://a248.e.akamai.net/assets.github.com/images/error/angry_unicorn.png?1259026914" width="200" />
  <h1>Page did not respond in a timely fashion.</h1>
  <p><a href="http://status.github.com">Check our status site for alerts.</a></p>
  <p>
    Either you found a page that took too long to render or<br />
    we're getting more requests right now than we can handle.
  </p>
  <ul>
    <li>
      You can try
      <a href="javascript: window.location.reload()">refreshing the page,</a>
      the problem may be temporary.
    </li>
    <li>
      <a href="http://github.s3.amazonaws.com/misc/down.html">
        Learn how to deal with GitHub outages and other access problems.
      </a>
    </li>
  </ul>
</div>

          </div>
          <div class="context-overlay"></div>
        </div>

      <!-- footer -->
      <div id="footer" >
        
  <div class="upper_footer">
     <div class="container clearfix">

       <!--[if IE]><h4 id="blacktocat_ie">GitHub Links</h4><![endif]-->
       <![if !IE]><h4 id="blacktocat">GitHub Links</h4><![endif]>

       <ul class="footer_nav">
         <h4>GitHub</h4>
         <li><a href="https://github.com/about">About</a></li>
         <li><a href="https://github.com/blog">Blog</a></li>
         <li><a href="https://github.com/features">Features</a></li>
         <li><a href="https://github.com/contact">Contact &amp; Support</a></li>
         <li><a href="https://github.com/training">Training</a></li>
         <li><a href="http://enterprise.github.com/">GitHub Enterprise</a></li>
         <li><a href="http://status.github.com/">Site Status</a></li>
       </ul>

       <ul class="footer_nav">
         <h4>Tools</h4>
         <li><a href="http://get.gaug.es/">Gauges: Analyze web traffic</a></li>
         <li><a href="http://speakerdeck.com">Speaker Deck: Presentations</a></li>
         <li><a href="https://gist.github.com">Gist: Code snippets</a></li>
         <li><a href="http://mac.github.com/">GitHub for Mac</a></li>
         <li><a href="http://mobile.github.com/">Issues for iPhone</a></li>
         <li><a href="http://jobs.github.com/">Job Board</a></li>
       </ul>

       <ul class="footer_nav">
         <h4>Extras</h4>
         <li><a href="http://shop.github.com/">GitHub Shop</a></li>
         <li><a href="http://octodex.github.com/">The Octodex</a></li>
       </ul>

       <ul class="footer_nav">
         <h4>Documentation</h4>
         <li><a href="http://help.github.com/">GitHub Help</a></li>
         <li><a href="http://developer.github.com/">Developer API</a></li>
         <li><a href="http://github.github.com/github-flavored-markdown/">GitHub Flavored Markdown</a></li>
         <li><a href="http://pages.github.com/">GitHub Pages</a></li>
       </ul>

     </div><!-- /.site -->
  </div><!-- /.upper_footer -->

<div class="lower_footer">
  <div class="container clearfix">
    <!--[if IE]><div id="legal_ie"><![endif]-->
    <![if !IE]><div id="legal"><![endif]>
      <ul>
          <li><a href="https://github.com/site/terms">Terms of Service</a></li>
          <li><a href="https://github.com/site/privacy">Privacy</a></li>
          <li><a href="https://github.com/security">Security</a></li>
      </ul>

      <p>&copy; 2012 <span title="s from fe4.rs.github.com">GitHub</span> Inc. All rights reserved.</p>
    </div><!-- /#legal or /#legal_ie-->

      <div class="sponsor">
        <a href="http://www.rackspace.com" class="logo">
          <img alt="Dedicated Server" height="36" src="https://a248.e.akamai.net/assets.github.com/images/modules/footer/rackspace_logo.png?v2" width="38" />
        </a>
        Powered by the <a href="http://www.rackspace.com ">Dedicated
        Servers</a> and<br/> <a href="http://www.rackspacecloud.com">Cloud
        Computing</a> of Rackspace Hosting<span>&reg;</span>
      </div>
  </div><!-- /.site -->
</div><!-- /.lower_footer -->

      </div><!-- /#footer -->

    

<div id="keyboard_shortcuts_pane" class="instapaper_ignore readability-extra" style="display:none">
  <h2>Keyboard Shortcuts <small><a href="#" class="js-see-all-keyboard-shortcuts">(see all)</a></small></h2>

  <div class="columns threecols">
    <div class="column first">
      <h3>Site wide shortcuts</h3>
      <dl class="keyboard-mappings">
        <dt>s</dt>
        <dd>Focus site search</dd>
      </dl>
      <dl class="keyboard-mappings">
        <dt>?</dt>
        <dd>Bring up this help dialog</dd>
      </dl>
    </div><!-- /.column.first -->

    <div class="column middle" style='display:none'>
      <h3>Commit list</h3>
      <dl class="keyboard-mappings">
        <dt>j</dt>
        <dd>Move selection down</dd>
      </dl>
      <dl class="keyboard-mappings">
        <dt>k</dt>
        <dd>Move selection up</dd>
      </dl>
      <dl class="keyboard-mappings">
        <dt>c <em>or</em> o <em>or</em> enter</dt>
        <dd>Open commit</dd>
      </dl>
      <dl class="keyboard-mappings">
        <dt>y</dt>
        <dd>Expand URL to its canonical form</dd>
      </dl>
    </div><!-- /.column.first -->

    <div class="column last" style='display:none'>
      <h3>Pull request list</h3>
      <dl class="keyboard-mappings">
        <dt>j</dt>
        <dd>Move selection down</dd>
      </dl>
      <dl class="keyboard-mappings">
        <dt>k</dt>
        <dd>Move selection up</dd>
      </dl>
      <dl class="keyboard-mappings">
        <dt>o <em>or</em> enter</dt>
        <dd>Open issue</dd>
      </dl>
    </div><!-- /.columns.last -->

  </div><!-- /.columns.equacols -->

  <div style='display:none'>
    <div class="rule"></div>

    <h3>Issues</h3>

    <div class="columns threecols">
      <div class="column first">
        <dl class="keyboard-mappings">
          <dt>j</dt>
          <dd>Move selection down</dd>
        </dl>
        <dl class="keyboard-mappings">
          <dt>k</dt>
          <dd>Move selection up</dd>
        </dl>
        <dl class="keyboard-mappings">
          <dt>x</dt>
          <dd>Toggle selection</dd>
        </dl>
        <dl class="keyboard-mappings">
          <dt>o <em>or</em> enter</dt>
          <dd>Open issue</dd>
        </dl>
      </div><!-- /.column.first -->
      <div class="column middle">
        <dl class="keyboard-mappings">
          <dt>I</dt>
          <dd>Mark selection as read</dd>
        </dl>
        <dl class="keyboard-mappings">
          <dt>U</dt>
          <dd>Mark selection as unread</dd>
        </dl>
        <dl class="keyboard-mappings">
          <dt>e</dt>
          <dd>Close selection</dd>
        </dl>
        <dl class="keyboard-mappings">
          <dt>y</dt>
          <dd>Remove selection from view</dd>
        </dl>
      </div><!-- /.column.middle -->
      <div class="column last">
        <dl class="keyboard-mappings">
          <dt>c</dt>
          <dd>Create issue</dd>
        </dl>
        <dl class="keyboard-mappings">
          <dt>l</dt>
          <dd>Create label</dd>
        </dl>
        <dl class="keyboard-mappings">
          <dt>i</dt>
          <dd>Back to inbox</dd>
        </dl>
        <dl class="keyboard-mappings">
          <dt>u</dt>
          <dd>Back to issues</dd>
        </dl>
        <dl class="keyboard-mappings">
          <dt>/</dt>
          <dd>Focus issues search</dd>
        </dl>
      </div>
    </div>
  </div>

  <div style='display:none'>
    <div class="rule"></div>

    <h3>Issues Dashboard</h3>

    <div class="columns threecols">
      <div class="column first">
        <dl class="keyboard-mappings">
          <dt>j</dt>
          <dd>Move selection down</dd>
        </dl>
        <dl class="keyboard-mappings">
          <dt>k</dt>
          <dd>Move selection up</dd>
        </dl>
        <dl class="keyboard-mappings">
          <dt>o <em>or</em> enter</dt>
          <dd>Open issue</dd>
        </dl>
      </div><!-- /.column.first -->
    </div>
  </div>

  <div style='display:none'>
    <div class="rule"></div>

    <h3>Network Graph</h3>
    <div class="columns equacols">
      <div class="column first">
        <dl class="keyboard-mappings">
          <dt><span class="badmono">←</span> <em>or</em> h</dt>
          <dd>Scroll left</dd>
        </dl>
        <dl class="keyboard-mappings">
          <dt><span class="badmono">→</span> <em>or</em> l</dt>
          <dd>Scroll right</dd>
        </dl>
        <dl class="keyboard-mappings">
          <dt><span class="badmono">↑</span> <em>or</em> k</dt>
          <dd>Scroll up</dd>
        </dl>
        <dl class="keyboard-mappings">
          <dt><span class="badmono">↓</span> <em>or</em> j</dt>
          <dd>Scroll down</dd>
        </dl>
        <dl class="keyboard-mappings">
          <dt>t</dt>
          <dd>Toggle visibility of head labels</dd>
        </dl>
      </div><!-- /.column.first -->
      <div class="column last">
        <dl class="keyboard-mappings">
          <dt>shift <span class="badmono">←</span> <em>or</em> shift h</dt>
          <dd>Scroll all the way left</dd>
        </dl>
        <dl class="keyboard-mappings">
          <dt>shift <span class="badmono">→</span> <em>or</em> shift l</dt>
          <dd>Scroll all the way right</dd>
        </dl>
        <dl class="keyboard-mappings">
          <dt>shift <span class="badmono">↑</span> <em>or</em> shift k</dt>
          <dd>Scroll all the way up</dd>
        </dl>
        <dl class="keyboard-mappings">
          <dt>shift <span class="badmono">↓</span> <em>or</em> shift j</dt>
          <dd>Scroll all the way down</dd>
        </dl>
      </div><!-- /.column.last -->
    </div>
  </div>

  <div style='display:none'>
    <div class="rule"></div>
    <div class="columns threecols">
      <div class="column first" style='display:none'>
        <h3>Source Code Browsing</h3>
        <dl class="keyboard-mappings">
          <dt>t</dt>
          <dd>Activates the file finder</dd>
        </dl>
        <dl class="keyboard-mappings">
          <dt>l</dt>
          <dd>Jump to line</dd>
        </dl>
        <dl class="keyboard-mappings">
          <dt>w</dt>
          <dd>Switch branch/tag</dd>
        </dl>
        <dl class="keyboard-mappings">
          <dt>y</dt>
          <dd>Expand URL to its canonical form</dd>
        </dl>
      </div>
    </div>
  </div>
</div>

    <div id="markdown-help" class="instapaper_ignore readability-extra">
  <h2>Markdown Cheat Sheet</h2>

  <div class="cheatsheet-content">

  <div class="mod">
    <div class="col">
      <h3>Format Text</h3>
      <p>Headers</p>
      <pre>
# This is an &lt;h1&gt; tag
## This is an &lt;h2&gt; tag
###### This is an &lt;h6&gt; tag</pre>
     <p>Text styles</p>
     <pre>
*This text will be italic*
_This will also be italic_
**This text will be bold**
__This will also be bold__

*You **can** combine them*
</pre>
    </div>
    <div class="col">
      <h3>Lists</h3>
      <p>Unordered</p>
      <pre>
* Item 1
* Item 2
  * Item 2a
  * Item 2b</pre>
     <p>Ordered</p>
     <pre>
1. Item 1
2. Item 2
3. Item 3
   * Item 3a
   * Item 3b</pre>
    </div>
    <div class="col">
      <h3>Miscellaneous</h3>
      <p>Images</p>
      <pre>
![GitHub Logo](/images/logo.png)
Format: ![Alt Text](url)
</pre>
     <p>Links</p>
     <pre>
http://github.com - automatic!
[GitHub](http://github.com)</pre>
<p>Blockquotes</p>
     <pre>
As Kanye West said:

> We're living the future so
> the present is our past.
</pre>
    </div>
  </div>
  <div class="rule"></div>

  <h3>Code Examples in Markdown</h3>
  <div class="col">
      <p>Syntax highlighting with <a href="http://github.github.com/github-flavored-markdown/" title="GitHub Flavored Markdown" target="_blank">GFM</a></p>
      <pre>
```javascript
function fancyAlert(arg) {
  if(arg) {
    $.facebox({div:'#foo'})
  }
}
```</pre>
    </div>
    <div class="col">
      <p>Or, indent your code 4 spaces</p>
      <pre>
Here is a Python code example
without syntax highlighting:

    def foo:
      if not bar:
        return true</pre>
    </div>
    <div class="col">
      <p>Inline code for comments</p>
      <pre>
I think you should use an
`&lt;addr&gt;` element here instead.</pre>
    </div>
  </div>

  </div>
</div>


    <div class="ajax-error-message">
      <p><span class="icon"></span> Something went wrong with that request. Please try again. <a href="javascript:;" class="ajax-error-dismiss">Dismiss</a></p>
    </div>

    
    
    
    
  </body>
</html>
</script><div style='margin-bottom:1em;padding:0;'><noscript><code><pre style='overflow:auto;margin:0;padding:0;border:1px solid #DDD;'>&lt;html&gt;&lt;body&gt;You are being &lt;a href=&quot;https://raw.github.com/gist/1234379/fake_console.js&quot;&gt;redirected&lt;/a&gt;.&lt;/body&gt;&lt;/html&gt;</pre></code></noscript></div>
]]></content:encoded>
			<wfw:commentRss>http://otaqui.com/blog/1079/stop-console-log-causing-errors-in-ie6-and-other-browsers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple Javascript Validator Library &#8211; Validator.js</title>
		<link>http://otaqui.com/blog/1076/simple-javascript-validator-library-validator-js/</link>
		<comments>http://otaqui.com/blog/1076/simple-javascript-validator-library-validator-js/#comments</comments>
		<pubDate>Sun, 14 Aug 2011 05:58:36 +0000</pubDate>
		<dc:creator>pete</dc:creator>
				<category><![CDATA[Professional]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[webdev]]></category>

		<guid isPermaLink="false">http://otaqui.com/blog/?p=1076</guid>
		<description><![CDATA[I had a need to do some data validation in javascript, and all the libraries I looked at seemed quite opinionated about *what* you were going to validate &#8211; i.e. form data &#8211; let alone the increase in server-side javascript in the last couple of years. My data wasn&#8217;t directly tied to a form, so [...]]]></description>
			<content:encoded><![CDATA[<p>I had a need to do some data validation in javascript, and all the libraries I looked at seemed quite opinionated about *what* you were going to validate &#8211; i.e. form data &#8211; let alone the increase in server-side javascript in the last couple of years. My data wasn&#8217;t directly tied to a form, so it didn&#8217;t quite seem worthwhile trying to shoe horn my needs into what the libraries expected, and I could also see a need for a validation library that could be adapted for Node.</p>
<p>Enter <a href="https://pete-otaqui.github.com/Validator.js">Validator.js</a>.</p>
<p>Validator&#8217;s only dependency is on <a href="http://documentcloud.github.com/underscore.js">underscore.js</a> from Document Cloud.</p>
<p>Validator has two usage forms: the first for very quick and simple one-off cases:</p>
<pre class="brush: javascript">
// Simple use:
var result
result = Validator.isEmail(&#039;not_an_email&#039;);
console.log(result); // false
result = Validator.isEmail(&#039;joe@example.com&#039;);
console.log(result); // true
</pre>
<p>I found this on its own quite a lot more flexible than most of the form-driven libraries out there.  However, I also wanted to be able to create more complex sets of validations to run on a piece of data.  For that case, you create an instance of Validator and use it&#8217;s add() method:</p>
<pre class="brush: javascript">
var result,
    myValidator

myValidator = new Validator();

myValidator.add(&#039;unique&#039;);
myValidator.add(&#039;minLength&#039;, 6);

result = myValidator.validate( [1, 2, 3, 4, 5, 6, 6] );
console.log(result); // false, the array is long enough but contains non-unique members
</pre>
<p>This got me a fair bit closer to what I wanted, but you don&#8217;t know which part failed, so it&#8217;s harder to give reasonable feedback. I added a set of error messages to validator instances which gets populated after a call to validate():</p>
<pre class="brush: javascript">
var result,
    myValidator

myValidator = new Validator();

myValidator.add(&#039;unique&#039;);
myValidator.add(&#039;minLength&#039;, 6);
myValidator.add(&#039;maxLength&#039;, 8);

result = myValidator.validate( [1, 2, 3, 4, 5, 6, 6, 8, 9, 10] );
console.log(result); // false, the array is long enough but contains non-unique members
console.log(myValidator.errors);
/*
myValidator.errors == [
    &#039;The list must be made up of unique items&#039;,
    &#039;The list is too long&#039;
]
*/
</pre>
<p>Again, this is pretty good but even though Validator supports adding messages in any language you want and falling back (by default) to English (see the source code), default error messages still aren&#8217;t always what you need.  I also added the ability to set a custom error message per &#8220;validation&#8221;.</p>
<pre class="brush: javascript">
var result,
    myValidator

myValidator = new Validator();

myValidator.add(&#039;unique&#039;).message(&#039;You are repeating yourself&#039;);
myValidator.add(&#039;minLength&#039;, 6).message(&#039;Too tiny!&#039;);
myValidator.add(&#039;maxLength&#039;, 8).message(&#039;Too bloated!&#039;);

result = myValidator.validate( [1, 2, 3, 4, 5, 6, 6, 8, 9, 10] );
console.log(result); // false, the array is long enough but contains non-unique members
console.log(myValidator.errors);
/*
myValidator.errors == [
    &#039;You are repeating yourself&#039;,
    &#039;Too bloated!&#039;
]
*/
</pre>
<p>You can also chain calls to add() and message():</p>
<pre class="brush: javascript">
var result,
    myValidator

myValidator = new Validator();

myValidator.add(&#039;unique&#039;).message(&#039;You are repeating yourself&#039;)
    .add(&#039;minLength&#039;, 6).message(&#039;Too tiny!&#039;)
    .add(&#039;maxLength&#039;, 8).message(&#039;Too bloated!&#039;);
</pre>
<p>I&#8217;ve added some code which should make it easy to use this as a CommonJS AMD javascript module.  In it&#8217;s default form you can just include it with a script tag.</p>
<p>If you&#8217;re interested in developing Validator itself, the project is tested with <a href="http://pivotal.github.com/jasmine/">Jasmine</a> and documented with <a href="http://code.google.com/p/jsdoc-toolkit/">JSDoc</a>.  Both of these can be run with Rake, and the easiest way to get setup is to use <a href="http://gembundler.com/">Bundler</a>.  Once you&#8217;ve got the dependencies you get three rake tasks:</p>
<pre class="brush: bash">
# Start the jasmine server, and open http://localhost:8888/ to run the test suite:
$ rake jasmine
# Start the jasmine server and also run a browser through the tests automatically:
$ rake jasmine:ci
# Generate the docs
$ rake jsdoc
</pre>
<p>If you fork the project and add any more validations, please also add tests and docs.</p>
]]></content:encoded>
			<wfw:commentRss>http://otaqui.com/blog/1076/simple-javascript-validator-library-validator-js/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Testing remote (PHP) websites with Capybara, Cucumber, Mechanize, Selenium 2 Webdriver &#8230; and SauceLabs</title>
		<link>http://otaqui.com/blog/1072/testing-remote-php-websites-with-capybara-cucumber-mechanize-selenium-2-webdriver-and-saucelabs/</link>
		<comments>http://otaqui.com/blog/1072/testing-remote-php-websites-with-capybara-cucumber-mechanize-selenium-2-webdriver-and-saucelabs/#comments</comments>
		<pubDate>Thu, 11 Aug 2011 14:40:16 +0000</pubDate>
		<dc:creator>pete</dc:creator>
				<category><![CDATA[Professional]]></category>
		<category><![CDATA[capybara]]></category>
		<category><![CDATA[cucumber]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://otaqui.com/blog/?p=1072</guid>
		<description><![CDATA[This is more or less the perfect setup for me, and it lets us run our tests against our PHP web application using the very fast mechanize driver where possible, and for tests that require javascript we can use either the &#8220;normal&#8221; selenium driver in capybara, or send the tests off to your local grid, [...]]]></description>
			<content:encoded><![CDATA[<p>This is more or less the perfect setup for me, and it lets us run our tests against our PHP web application using the very fast mechanize driver where possible, and for tests that require javascript we can use either the &#8220;normal&#8221; selenium driver in capybara, or send the tests off to your local grid, or even send them off to Sauce Labs where we want to cover more platforms and versions than we have setup locally.</p>
<p>https://gist.github.com/1139797</p>
<p><script src="https://gist.github.com/1139797.js"> </script></p>
<p>Next step &#8230; running the tests in parallel!</p>
]]></content:encoded>
			<wfw:commentRss>http://otaqui.com/blog/1072/testing-remote-php-websites-with-capybara-cucumber-mechanize-selenium-2-webdriver-and-saucelabs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Building Conway&#8217;s Game of Life in Javascript</title>
		<link>http://otaqui.com/blog/1020/building-conways-game-of-life-in-javascript/</link>
		<comments>http://otaqui.com/blog/1020/building-conways-game-of-life-in-javascript/#comments</comments>
		<pubDate>Tue, 02 Aug 2011 12:00:06 +0000</pubDate>
		<dc:creator>pete</dc:creator>
				<category><![CDATA[Professional]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[webdev]]></category>

		<guid isPermaLink="false">http://otaqui.com/blog/?p=1020</guid>
		<description><![CDATA[As part of an interesting exercise at work, I built an implementation of Conway&#8217;s Game Of Life in Javascript. If you haven&#8217;t come across the Game Of Life, it&#8217;s really quite interesting and worth looking at. My colleagues also made variations, including canvas-based and Web GL 3 dimensional (there was even discussion about n-dimensional, with [...]]]></description>
			<content:encoded><![CDATA[<p>As part of an interesting exercise at work, I built an implementation of <a href="http://en.wikipedia.org/wiki/Conway%27s_Game_of_Life">Conway&#8217;s Game Of Life</a> in Javascript.  If you haven&#8217;t come across the Game Of Life, it&#8217;s really quite interesting and worth looking at.  My colleagues also made variations, including canvas-based and Web GL 3 dimensional (there was even discussion about n-dimensional, with sliders to view the 4th, 5th and further dimensions).  My particular take was to make the game space &#8220;infinite&#8221; rather than a fixed grid.</p>
<p>It&#8217;s not really infinite of course, I haven&#8217;t made any attempt to have a position greater than Number.MAX_VALUE.  The real point is that it is possible to have a huge playing area, and only the living &#038; possibly-living-next-round cells are taken into account.</p>
<p>I avoided using any ready-made frameworks, in part so that it could be transported to the server-side on top of something like <a href="http://nodejs.org">NodeJS</a> &#8211; I was imagining a multi-player game where each user could &#8220;paint&#8221; cells onto the canvas, and maybe even that next-generation cells would take an identifier from their parents, letting people &#8220;fight&#8221;.  I haven&#8217;t really got the time for that at the moment, but it seemed a nice idea.</p>
]]></content:encoded>
			<wfw:commentRss>http://otaqui.com/blog/1020/building-conways-game-of-life-in-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting a reference to an unselected radiobutton (using jQuery)</title>
		<link>http://otaqui.com/blog/1033/getting-a-reference-to-an-unselected-radiobutton-using-jquery/</link>
		<comments>http://otaqui.com/blog/1033/getting-a-reference-to-an-unselected-radiobutton-using-jquery/#comments</comments>
		<pubDate>Tue, 02 Aug 2011 11:59:09 +0000</pubDate>
		<dc:creator>pete</dc:creator>
				<category><![CDATA[Professional]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://otaqui.com/blog/?p=1033</guid>
		<description><![CDATA[The &#8220;change&#8221; event on a radiobutton input only fires when it becomes selected. If you want to trigger some behaviour on an unselected radiobutton, then you have to bind to the change event of the radiogroup, which you can do like so: &#60;ul&#62; &#60;li&#62; &#60;input id=&#34;r1&#34; name=&#34;something&#34; type=&#34;radio&#34; value=&#34;basic&#34; /&#62; &#60;label for=&#34;r1&#34;&#62;Basic&#60;/label&#62; &#60;/li&#62; &#60;li&#62; &#60;input [...]]]></description>
			<content:encoded><![CDATA[<p>The &#8220;change&#8221; event on a radiobutton input only fires when it becomes selected.  If you want to trigger some behaviour on an unselected radiobutton, then you have to bind to the change event of the radiogroup, which you can do like so:</p>
<pre class="brush: html">
&lt;ul&gt;
  &lt;li&gt;
    &lt;input id=&quot;r1&quot; name=&quot;something&quot; type=&quot;radio&quot; value=&quot;basic&quot; /&gt;
    &lt;label for=&quot;r1&quot;&gt;Basic&lt;/label&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;input id=&quot;r2&quot; name=&quot;something&quot; type=&quot;radio&quot; value=&quot;standard&quot; /&gt;
    &lt;label for=&quot;r2&quot;&gt;Standard&lt;/label&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;input id=&quot;r3&quot; name=&quot;something&quot; type=&quot;radio&quot; value=&quot;advanced&quot; /&gt;
    &lt;label for=&quot;r3&quot;&gt;Advanced&lt;/label&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;script&gt;
$(&quot;input[name=&#039;inputName&#039;]&quot;).change(function(ev) {

});
&lt;/script&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://otaqui.com/blog/1033/getting-a-reference-to-an-unselected-radiobutton-using-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RTL Input text with large text-indent value &#8220;magically scrolls&#8221; in Opera</title>
		<link>http://otaqui.com/blog/1028/rtl-input-text-with-large-text-indent-value-magically-scrolls-in-opera/</link>
		<comments>http://otaqui.com/blog/1028/rtl-input-text-with-large-text-indent-value-magically-scrolls-in-opera/#comments</comments>
		<pubDate>Tue, 25 Jan 2011 16:32:31 +0000</pubDate>
		<dc:creator>pete</dc:creator>
				<category><![CDATA[Professional]]></category>
		<category><![CDATA[webdev]]></category>

		<guid isPermaLink="false">http://otaqui.com/blog/?p=1028</guid>
		<description><![CDATA[This is a pretty weird browser bug. Opera RTL Scrolly Text Indent Bug. If your content is RTL and you are using the large text-indent CSS property on an input tag (so that you can use a background image, while keeping the text invisible to most users but still available to screen readers) you get [...]]]></description>
			<content:encoded><![CDATA[<p>This is a pretty weird browser bug.</p>
<p><a href="http://otaqui.com/code/opera-rtl-scrolly-text-indent/">Opera RTL Scrolly Text Indent Bug</a>.</p>
<p>If your content is RTL and you are using the large text-indent CSS property on an input tag (so that you can use a background image, while keeping the text invisible to most users but still available to screen readers) you get a couple of odd behaviours in Opera:</p>
<ol>
<li>The text is not indented.  Well ok, that&#8217;s at least a &#8220;normal&#8221; kind of bug.</li>
<li>If you right-click on the button, and leave the menu open for a few seconds, the text <em><strong>magically starts scrolling out of the way</strong></em>.</li>
</ol>
<p>I&#8217;ve submitted a bug report to Opera.  I&#8217;d be interested if anyone else is seeing the same behaviour, or any related RTL weirdness.</p>
]]></content:encoded>
			<wfw:commentRss>http://otaqui.com/blog/1028/rtl-input-text-with-large-text-indent-value-magically-scrolls-in-opera/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Javascript EventEmitter Redux, now on github</title>
		<link>http://otaqui.com/blog/1025/javascript-eventemitter-redux-now-on-github/</link>
		<comments>http://otaqui.com/blog/1025/javascript-eventemitter-redux-now-on-github/#comments</comments>
		<pubDate>Tue, 11 Jan 2011 14:37:00 +0000</pubDate>
		<dc:creator>pete</dc:creator>
				<category><![CDATA[Professional]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://otaqui.com/blog/?p=1025</guid>
		<description><![CDATA[I&#8217;ve added some more features to the EventEmitter mixin (like actually working listener removal) and posted it to github: EventEmitter on github It&#8217;s fairly simple to use &#8230; something like this: var MyKlass = function() {}; EventEmitter.augment(MyKlass.prototype); /** * Show me * * @fires shown */ MyKlass.prototype.showMe = function() { this.trigger(&#039;shown&#039;, {&#039;visible&#039;:true}); } var myInstance [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve added some more features to the EventEmitter mixin (like actually working listener removal) and posted it to github:</p>
<p><a href="https://github.com/pete-otaqui/EventEmitter">EventEmitter on github</a></p>
<p>It&#8217;s fairly simple to use &#8230; something like this:</p>
<pre class="brush: javascript">
var MyKlass = function() {};
EventEmitter.augment(MyKlass.prototype);

/**
 * Show me
 *
 * @fires shown
 */
MyKlass.prototype.showMe = function() {
  this.trigger(&#039;shown&#039;, {&#039;visible&#039;:true});
}

var myInstance = new MyKlass();
myInstance.on(&#039;shown&#039;, function(e) {
  console.log(e.visible);
}
myInstance.showMe();
</pre>
]]></content:encoded>
			<wfw:commentRss>http://otaqui.com/blog/1025/javascript-eventemitter-redux-now-on-github/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding Vertical Split support to GNU Screen in Mac OS X Snow Leopard</title>
		<link>http://otaqui.com/blog/1011/adding-vertical-split-support-to-gnu-screen-in-mac-os-x-snow-leopard/</link>
		<comments>http://otaqui.com/blog/1011/adding-vertical-split-support-to-gnu-screen-in-mac-os-x-snow-leopard/#comments</comments>
		<pubDate>Thu, 06 Jan 2011 09:27:44 +0000</pubDate>
		<dc:creator>pete</dc:creator>
				<category><![CDATA[Professional]]></category>
		<category><![CDATA[command-line]]></category>

		<guid isPermaLink="false">http://otaqui.com/blog/?p=1011</guid>
		<description><![CDATA[Evan Meagher supplies a great patch to the source of GNU Screen which adds vertical split support on OS X. This is really useful, since so many displays are widescreen these days, and it also means you can create a reasonable dashboard with screen. The patch has worked without a hitch for me so far. [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://evanmeagher.net/2010/12/patching-screen-with-vertical-split-in-os">Evan Meagher supplies a great patch</a> to the source of GNU Screen which adds vertical split support on OS X.</p>
<p>This is really useful, since so many displays are widescreen these days, and it also means you can create a reasonable dashboard with screen.  The patch has worked without a hitch for me so far.</p>
<p>Thanks Evan!</p>
]]></content:encoded>
			<wfw:commentRss>http://otaqui.com/blog/1011/adding-vertical-split-support-to-gnu-screen-in-mac-os-x-snow-leopard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Javascript EventEmitter Mixin</title>
		<link>http://otaqui.com/blog/953/javascript-eventemitter-mixin/</link>
		<comments>http://otaqui.com/blog/953/javascript-eventemitter-mixin/#comments</comments>
		<pubDate>Mon, 15 Nov 2010 21:18:58 +0000</pubDate>
		<dc:creator>pete</dc:creator>
				<category><![CDATA[Professional]]></category>

		<guid isPermaLink="false">http://otaqui.com/blog/?p=953</guid>
		<description><![CDATA[/** * EventEmitter Mixin * * Designed to be used in conjunction with a mixin &#34;augment&#34; function, * such as http://chamnapchhorn.blogspot.com/2009/05/javascript-mixins.html * * @usage augment(MyClass, EventEmitter); * my_inst = new MyClass(); * my_inst.on(&#039;someEvent&#039;, function(e){ console.dir(e); }); * my_inst.trigger(&#039;someEvent&#039;, {eventProp:&#039;value&#039;}); */ var EventEmitter = function() {}; EventEmitter.prototype.on = function(name, callback, context) { if ( !context ) [...]]]></description>
			<content:encoded><![CDATA[<pre class="brush: javascript">
/**
 * EventEmitter Mixin
 *
 * Designed to be used in conjunction with a mixin &quot;augment&quot; function,
 * such as http://chamnapchhorn.blogspot.com/2009/05/javascript-mixins.html
 *
 * @usage augment(MyClass, EventEmitter);
 * my_inst = new MyClass();
 * my_inst.on(&#039;someEvent&#039;, function(e){ console.dir(e); });
 * my_inst.trigger(&#039;someEvent&#039;, {eventProp:&#039;value&#039;});
 */
var EventEmitter = function() {};
EventEmitter.prototype.on = function(name, callback, context) {
  if ( !context ) context = this;
  if ( !this._listeners ) this._listeners = {};
  if ( !this._listeners[name] ) this._listeners[name] = [];
  var f = function(e) { callback.apply(context, [e]); };
  this._listeners[name].push(f);
};
EventEmitter.prototype.trigger = function(name, event) {
  if ( !this._listeners ) this._listeners = {};
  if ( !this._listeners[name] ) return;
  var i = this._listeners[name].length;
  while ( i-- ) this._listeners[name][i](event);
};
EventEmitter.prototype.removeListener = function(name, callback) {
  if ( !this._listeners ) this._listeners = {};
  if ( !this._listeners[name] ) return;
  var i = this._listeners[name].length;
  while ( i-- ) {
    if ( this._listeners[name][i] === callback ) {
      this._listeners[name].splice(i, 1);
    }
  }
};
</pre>
]]></content:encoded>
			<wfw:commentRss>http://otaqui.com/blog/953/javascript-eventemitter-mixin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Started work on jQuery UI Modal widget</title>
		<link>http://otaqui.com/blog/919/started-work-on-jquery-ui-modal-widget/</link>
		<comments>http://otaqui.com/blog/919/started-work-on-jquery-ui-modal-widget/#comments</comments>
		<pubDate>Wed, 13 Oct 2010 14:26:49 +0000</pubDate>
		<dc:creator>pete</dc:creator>
				<category><![CDATA[Professional]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[webdev]]></category>

		<guid isPermaLink="false">http://otaqui.com/blog/?p=919</guid>
		<description><![CDATA[I&#8217;ve started working a jQuery UI Modal widget, for use in a project built on top of the widget library. We have very high accessibility standards, and the current &#8220;{modal:true}&#8221; option for the dialog widget unfortunately wasn&#8217;t as good as we needed. Seeing that the team had identified the need for a standalone Modal widget, [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve started working a jQuery UI Modal widget, for use in a project built on top of the widget library.</p>
<p>We have very high accessibility standards, and the current &#8220;{modal:true}&#8221; option for the dialog widget unfortunately wasn&#8217;t as good as we needed.  Seeing that the team had identified the need for <a href="http://wiki.jqueryui.com/Modal">a standalone Modal widget</a>, the team thought we could try and get the ball rolling.</p>
<p>You can see the work in progress here in <a href="http://github.com/pete-otaqui/jquery-ui/blob/master/ui/jquery.ui.modal.js">the modal widget in my fork of jquery ui</a>.</p>
<p>I&#8217;ve also been having <a href="http://forum.jquery.com/topic/refactoring-dialog-overlay-in-preparation-for-modal-better-keyboard-accessibility">a discssion about the modal widget</a> with Scott Gonzalez of the jQuery UI team.</p>
]]></content:encoded>
			<wfw:commentRss>http://otaqui.com/blog/919/started-work-on-jquery-ui-modal-widget/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSSP: Loading CSS with Javascript &#8211; and getting an onload callback.</title>
		<link>http://otaqui.com/blog/890/cssp-loading-css-with-javascript-and-getting-an-onload-callback/</link>
		<comments>http://otaqui.com/blog/890/cssp-loading-css-with-javascript-and-getting-an-onload-callback/#comments</comments>
		<pubDate>Tue, 28 Sep 2010 14:16:18 +0000</pubDate>
		<dc:creator>pete</dc:creator>
				<category><![CDATA[Professional]]></category>
		<category><![CDATA[dojo]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[webdev]]></category>

		<guid isPermaLink="false">http://otaqui.com/blog/?p=890</guid>
		<description><![CDATA[It seems fairly straightforward to require CSS with Javascript. The most obvious method that I thought of was creating a &#60;link&#62; tag and appending it to the head of the document. An alternative would be to load the text of the css file with an ajax XHR call, and then inject that into a &#60;style&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>It seems fairly straightforward to require CSS with Javascript.  The most obvious method that I thought of was creating a &lt;link&gt; tag and appending it to the head of the document. An alternative would be to load the text of the css file with an ajax XHR call, and then inject that into a &lt;style&gt; tag.</p>
<p>These are both fine for most cases, but what about a situation where you have a hard dependency on the css for the javascript to work correctly?  You could take a best-guess at a wait time for the CSS to load, or even set the XHR to be synchronous &#8211; however both of these are very poor for both actual and perceived performance of your page (and the former may simply fail).</p>
<p>When might this be the case?  Let&#8217;s say you have some asynchronously loaded javascript that is intended to create a widget on the page, something like this (which assumes you are using jQuery as your dom library):</p>
<pre class="brush: javascript">

function moveLargePanels() {
    // make a panel container for large panels
    $(&#039;&lt;div id=&quot;largePanelContainer&quot;&gt;&lt;/div&gt;&#039;)
        .appendTo(&#039;body&#039;);
    $(&#039;.panel&#039;).each( function(i, panel) {
        if ( panel.outerWidth() &gt; 300 ) {
            panel.appendTo(&#039;#largePanelContainer&#039;);
        }
    }
}
</pre>
<p>And some corresponding CSS:</p>
<pre class="brush: css">
.panel {
    border:1px solid #000;
    padding: 20px;
}
</pre>
<p>The idea here is that, since there is some interaction between the logic in the javascript (a test for the &#8220;outerWidth&#8221;) and the styling in the CSS (setting the padding) that the javascript can only work correctly once the CSS has been loaded and applied.</p>
<p>This should be fine right?  Start the javascript and the css loading, and have events attached to the load of each letting you know when everything is ready and it&#8217;s safe to fire &#8220;moveLargePanels()&#8221;.  Wrong, or at least tricky, and essentially impossible if the CSS is loaded from a different domain to the hosting webpage.</p>
<p>You can get James Burke&#8217;s excellent description of this problem here:<br />
<a href="http://requirejs.org/docs/faq-advanced.html#css">http://requirejs.org/docs/faq-advanced.html#css</a><br />
And a first pass at solving this (in some browsers) here:<br />
<a href="http://bugs.dojotoolkit.org/ticket/5402">http://bugs.dojotoolkit.org/ticket/5402</a></p>
<p>Burke mentions a using a &#8220;well known&#8221; style rule to test whether the style is loaded.  I suggest a standard pattern for the rule, and also a mechanism for dynamically setting it.</p>
<h2>Enter CSSP</h2>
<p>You may have heard of <a href="http://remysharp.com/2007/10/08/what-is-jsonp/">JsonP</a> &#8211; a way of serving dynamically generated JSON which is padded with a method call (the method name is supplied in the query string of the URL), which allows for cross domain loading of javascript.  The idea behind CSSP is similar &#8211; it defines a pattern for loading css cross domain.  Instead of wrapping in a callback though, we can use the URL query string mechanism to supply the special &#8220;test rule&#8221; that we use.</p>
<h3>Dynamic Rule Pattern</h3>
<p>Given this url:</p>
<p>http://someserver.com/stylefile.css?cssp=123456</p>
<pre class="brush: php">
.panel { ... }
.largePanelsContainer { .. }

/* and the special rule: */
cssp { zIndex:123456; }
</pre>
<p>So, in whatever loader we want to build, we can add something like this (n.b. this isn&#8217;t tested code):</p>
<pre class="brush: javascript">
var cssp_counter = 0;
function loadCss(url, callback, className, zIndex) {
    // create a counter for special class names, so they are unique
    className = className || &#039;cssp&#039; + (cssp_counter++);
    zIndex = zIndex || 123456;
    url = url + &#039;?&#039; + className + &#039;=&#039; + zIndex;
    $(&#039;&lt;link&gt;&#039;)
        .attr({
            rel: &quot;stylesheet&quot;,
            type: &quot;text/css&quot;,
            href: url
        .appendTo(&#039;head&#039;);
    // append a dummy div to the body for the test
    var div = $(&#039;&lt;div&gt;&lt;/div&gt;&#039;)
        .addClass(className)
        .appendTo(&#039;body&#039;);
    // now poll for the z-index value:
    var cssp_interval = setInterval( function() {
        // if the zIndex is applied, we know the css has loaded
        if ( div.css(&#039;zIndex&#039;) == zIndex ) {
            div.remove();
            // callback:
            callback();
            clearInterval( cssp_interval );
        }
    }, 100);

}
</pre>
<p>The code above to do the loading and fire a callback is very naive.  It would be much better to have an event that can have listeners added, and to have some tests and some failure management like a maximum timeout.</p>
<h3>Default Rule Pattern</h3>
<p>This obviously presupposes that the CSS is dynamically generated to some degree, even just by adding the special rule to an otherwise static file.  I think that an alternative to the performance-conscious would be a &#8220;default&#8221; special rule, based on the css filename.  This needs some thought, and could well be tied to a build-step in your deployment process (you do have one, right?).  The pattern comes in two parts:</p>
<ul>
<li>There is a standard zIndex that is always used.</li>
<li>The filename includes the &#8220;special class name&#8221; that is used within.</li>
</ul>
<p>For example:</p>
<p>Given the file: <strong>styles.fhddgso9j.css</strong></p>
<pre class="brush: css">
.someclass { ... }
.otherclass { ... }

/* and the special rule */
.fhddgso9j { z-index: 123456; }
</pre>
<p>The javascript to go alone with this might look something like:</p>
<pre class="brush: javascript">
var cssp_counter = 0;
function loadCss(url, callback) {
    // create a counter for special class names, so they are unique
    className = getSpecialClassName(url);
    zIndex = 123456;
    $(&#039;&lt;link&gt;&#039;)
        .attr({
            rel: &quot;stylesheet&quot;,
            type: &quot;text/css&quot;,
            href: url
        .appendTo(&#039;head&#039;);
    // append a dummy div to the body for the test
    var div = $(&#039;&lt;div&gt;&lt;/div&gt;&#039;)
        .addClass(className)
        .appendTo(&#039;body&#039;);
    // now poll for the z-index value:
    var cssp_interval = setInterval( function() {
        // if the zIndex is applied, we know the css has loaded
        if ( div.css(&#039;zIndex&#039;) == zIndex ) {
            div.remove();
            // callback:
            callback();
            clearInterval( cssp_interval );
        }
    }, 100);
}
function getSpecialClassName(url) {
  // get just the filename, e.g. &quot;styles.9ufosdfij.css&quot;
  var filename = url.substring( url.lastIndexOf(&#039;/&#039;)+1, url.length);
  // split on the &quot;.&quot; marks
  var parts = filename.split(&#039;.&#039;);
  // assume it will be the second-to-last part (since the last should be &quot;css&quot;)
  var className = parts[ parts.length-2 ];
  return className;
}
</pre>
<p>As noted above, this naive, untested code.</p>
<h2>Wrapping Up</h2>
<p>Ideally I&#8217;d like any &#8220;css loader&#8221; to use actual browser events (or properties) where possible, and to fallback on this setup as a last resort.</p>
<p>If I get time I&#8217;ll implement this and put the code on github.  Please do get in touch if you&#8217;d like to pair on this!</p>
]]></content:encoded>
			<wfw:commentRss>http://otaqui.com/blog/890/cssp-loading-css-with-javascript-and-getting-an-onload-callback/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Review of &#8220;Simplicity is Highly Overrated&#8221;</title>
		<link>http://otaqui.com/blog/697/review-of-simplicity-is-highly-overrated/</link>
		<comments>http://otaqui.com/blog/697/review-of-simplicity-is-highly-overrated/#comments</comments>
		<pubDate>Mon, 06 Sep 2010 05:05:05 +0000</pubDate>
		<dc:creator>pete</dc:creator>
				<category><![CDATA[Professional]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://otaqui.com/blog/?p=697</guid>
		<description><![CDATA[Dan Norman writes that &#8220;simplicity is highly overrated&#8221; and asks whether you would buy an equivalent product with less features for the same, or more, money. Dan is a usability expert and although says that while he prefers simplicity and what I would call &#8220;poignancy&#8221; in design, most purchases are not based on the premise [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.jnd.org/dn.mss/simplicity_is_highly.html">Dan Norman writes that &#8220;simplicity is highly overrated&#8221;</a> and asks whether you would buy an equivalent product with less features for the same, or more, money.</p>
<p>Dan is a usability expert and although says that while he prefers simplicity and what I would call &#8220;poignancy&#8221; in design, most purchases are not based on the premise of being &#8220;just right&#8221;.  The article is a good read, but I think he misses a swathe of well selling products. He details various things like washing machines and other white goods (although lots of the same issues apply to software) but completely misses any discussion of personal electronics, and how long can one talk about design in that area without mentioning the ipod.</p>
<p>When the ipod first came out it was a very poor cousin to a great deal of its competitors in terms of features, let alone the number of controls.  It could play fewer music formats, it stopped you from powerful management of your music, it didn&#8217;t even have a radio!  Yet it sold incredibly well and very quickly got to the same point in the public consciousness that the Sony WalkMan did where a single product&#8217;s name became synonymous with a whole class of devices.</p>
<p>The ipod was not cheap.  Nor, despite its simplicity, did it *look* cheap, which Dan seems to be suggesting is inevitable.   It was excellently marketed, but it was also just a really good product with the entire user interface (what there was of it &#8211; not even a radio remember, let alone picture-viewing or other features that other mp3 players had at the time) being very simple to use.</p>
<p>Adding features is the &#8220;simple&#8221; way to try and boost the cost and sales of product (or a piece of software) but making &#8220;simplicity&#8221; the key feature that makes it worth more is pretty hard to beat in the long run.</p>
]]></content:encoded>
			<wfw:commentRss>http://otaqui.com/blog/697/review-of-simplicity-is-highly-overrated/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adobe CS3 &#8220;licensing for this product has stopped working&#8221; fix</title>
		<link>http://otaqui.com/blog/699/adobe-cs3-licensing-for-this-product-has-stopped-working-fix/</link>
		<comments>http://otaqui.com/blog/699/adobe-cs3-licensing-for-this-product-has-stopped-working-fix/#comments</comments>
		<pubDate>Wed, 23 Jun 2010 09:55:00 +0000</pubDate>
		<dc:creator>pete</dc:creator>
				<category><![CDATA[Professional]]></category>
		<category><![CDATA[webdev]]></category>

		<guid isPermaLink="false">http://otaqui.com/blog/?p=699</guid>
		<description><![CDATA[After getting a new computer, and restoring my old system from a Time Machine backup, I found my Adobe Web Premium CS3 stopped working. Every application I started (Photoshop, Fireworks, Flash, etc) gave the error message: Licensing for this product has stopped working. After following every suggestion I could find in Adobe&#8217;s knowledge base and [...]]]></description>
			<content:encoded><![CDATA[<p>After getting a new computer, and restoring my old system from a Time Machine backup, I found my Adobe Web Premium CS3 stopped working.  Every application I started (Photoshop, Fireworks, Flash, etc) gave the error message:</p>
<blockquote><p>Licensing for this product has stopped working.</p></blockquote>
<p>After following every suggestion I could find in Adobe&#8217;s knowledge base and various online articles, I still couldn&#8217;t get any of the applications to start.</p>
<p>As a final act of complete desperation, after many rounds of removal-reboot-reinstall, I finally ran the installer and chose a product that I had not installed before (Contribute).  Once that was done I started up the new app, and it asked me for my license key &#8211; which I entered and the app started.  Then I tried Photoshop and it started up fine!</p>
<p>So &#8211; if you didn&#8217;t do a complete install int he first place, one of the easiest things could be to add a new app to your install, and get that to reset your licensing for you.</p>
]]></content:encoded>
			<wfw:commentRss>http://otaqui.com/blog/699/adobe-cs3-licensing-for-this-product-has-stopped-working-fix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Public Opinion</title>
		<link>http://otaqui.com/blog/695/public-opinion/</link>
		<comments>http://otaqui.com/blog/695/public-opinion/#comments</comments>
		<pubDate>Tue, 22 Jun 2010 08:13:02 +0000</pubDate>
		<dc:creator>pete</dc:creator>
				<category><![CDATA[Professional]]></category>

		<guid isPermaLink="false">http://otaqui.com/blog/?p=695</guid>
		<description><![CDATA[News networks giving a greater voice to viewers because the social web is so popular are like a chef on the Titanic who, seeing the looming iceberg and fleeing customers, figures ice is the future and starts making snow cones. via XKCD.]]></description>
			<content:encoded><![CDATA[<blockquote><p>News networks giving a greater voice to viewers because the social web is so popular are like a chef on the Titanic who, seeing the looming iceberg and fleeing customers, figures ice is the future and starts making snow cones.</p></blockquote>
<p>via <a href="http://xkcd.com/756/">XKCD</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://otaqui.com/blog/695/public-opinion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>If We Had A Web Of Data I Would Build &#8230;</title>
		<link>http://otaqui.com/blog/643/if-we-had-a-web-of-data-i-would-build/</link>
		<comments>http://otaqui.com/blog/643/if-we-had-a-web-of-data-i-would-build/#comments</comments>
		<pubDate>Mon, 12 Apr 2010 14:24:45 +0000</pubDate>
		<dc:creator>pete</dc:creator>
				<category><![CDATA[Professional]]></category>
		<category><![CDATA[linked-data]]></category>
		<category><![CDATA[webdev]]></category>

		<guid isPermaLink="false">http://otaqui.com/blog/?p=643</guid>
		<description><![CDATA[Georgi Kobilarov has a post up asking what would you build with a function web of data and I have a few ideas. These all need fleshing out (and probably spell-checking ;), but if I didn&#8217;t post them now I might never get round to it! Shopping I think there are a few ways you [...]]]></description>
			<content:encoded><![CDATA[<p>Georgi Kobilarov has a post up asking <a href="http://blog.georgikobilarov.com/2010/04/with-a-web-of-data-what-would-you-do/">what would you build with a function web of data</a> and I have a few ideas.  These all need fleshing out (and probably spell-checking ;), but if I didn&#8217;t post them now I might never get round to it!</p>
<p><strong>Shopping</strong></p>
<p>I think there are a few ways you could use a web of linked data to make online grocery shopping better &#8211; comparing prices across stores, create shopping lists from recipes, and get recipes from lists of goods.</p>
<p><strong>Recruitment</strong></p>
<p>With jobs and resumés available as linked data, recruitment could become much more machine-enabled, giving managers better abilities to find people themselves rather than relying on agents who don&#8217;t always understand their clients&#8217; business or industry.  It could also help people looking for work in a similar way.  Types of skill, training and qualification could also be linked in, as could &#8220;linkedin&#8221; style personal recommendations.</p>
<p><strong>E-Learning</strong></p>
<p>Serious attempts have been made at making learning materials shareable and reusable.  As part of the data web, finding and consuming these materials becomes easier but more than that we could build a development plan generator.  Competency can be aligned to skills or training received, something that could be useful to government departments, schools, universities and business.</p>
]]></content:encoded>
			<wfw:commentRss>http://otaqui.com/blog/643/if-we-had-a-web-of-data-i-would-build/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>BBC Fisheye Greasemonkey Script</title>
		<link>http://otaqui.com/blog/646/bbc-fisheye-greasemonkey-script/</link>
		<comments>http://otaqui.com/blog/646/bbc-fisheye-greasemonkey-script/#comments</comments>
		<pubDate>Mon, 12 Apr 2010 09:15:08 +0000</pubDate>
		<dc:creator>pete</dc:creator>
				<category><![CDATA[Professional]]></category>
		<category><![CDATA[greasemonkey]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[webdev]]></category>

		<guid isPermaLink="false">http://otaqui.com/blog/?p=646</guid>
		<description><![CDATA[Greasemonkey script to reformat &#8220;Author&#8221; select elements on the BBC&#8217;s Fisheye repository browser, which are ridiculously long (because they contain a considerable chunk of certificate data) which messes with the whole page layout. Shrinking the selects to a more reasonable width fixes this and makes the site more usable. http://otaqui.com/code/bbc-fisheye/bbc-fisheye.user.js // ==UserScript== // @name BBC [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.greasespot.net/">Greasemonkey</a> script to reformat &#8220;Author&#8221; select elements on the BBC&#8217;s Fisheye repository browser, which are ridiculously long (because they contain a considerable chunk of certificate data) which messes with the whole page layout.  Shrinking the selects to a more reasonable width fixes this and makes the site more usable.</p>
<p><a href="http://otaqui.com/code/bbc-fisheye/bbc-fisheye.user.js">http://otaqui.com/code/bbc-fisheye/bbc-fisheye.user.js</a></p>
<pre class="brush: javascript">
// ==UserScript==
// @name           BBC FishEye
// @namespace      http://otaqui.com/code/bbc-fisheye
// @description    Make BBC&#039;s Fisheye look more like it should
// @include        https://fisheye.dev.bbc.co.uk/*
// ==/UserScript==
var elems = document.evaluate(
    &#039;//select[@name=&quot;wbauthor&quot;]&#039;,
    document,
    null,
    XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
    null
);
var i=0;
var sel;
while ( sel = elems.snapshotItem(i++) ) sel.style.width = &#039;200px&#039;;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://otaqui.com/blog/646/bbc-fisheye-greasemonkey-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bash Script for Serving Multiple Trac Projects and Sharing Authentication</title>
		<link>http://otaqui.com/blog/600/bash-script-for-serving-multiple-trac-projects-and-sharing-authentication/</link>
		<comments>http://otaqui.com/blog/600/bash-script-for-serving-multiple-trac-projects-and-sharing-authentication/#comments</comments>
		<pubDate>Tue, 30 Mar 2010 08:55:25 +0000</pubDate>
		<dc:creator>pete</dc:creator>
				<category><![CDATA[Professional]]></category>
		<category><![CDATA[command-line]]></category>
		<category><![CDATA[webdev]]></category>

		<guid isPermaLink="false">http://otaqui.com/blog/?p=600</guid>
		<description><![CDATA[I use Trac for personal projects, and I share some of these out with people as required. I use tracd (TracStandalone) for this, rather than a full-blown apache setup, since it serves my needs quite nicely and is a lot easier to turn on and off as required without tweaking apache config and rebooting the [...]]]></description>
			<content:encoded><![CDATA[<p>I use Trac for personal projects, and I share some of these out with people as required.  I use tracd (TracStandalone) for this, rather than a full-blown apache setup, since it serves my needs quite nicely and is a lot easier to turn on and off as required without tweaking apache config and rebooting the whole webserver.</p>
<p>All my projects live under a single parent directory, and I prefer to share a single users digest file between them all &#8211; so ideally I wanted to share a single tracd to run all my projects.  This is fairly straightforward on the command line:</p>
<pre class="brush: bash">
tracd --hostname=webhost.com -p 9876 \
--auth=&quot;*,/path/projects/people.htdigest,Realm&quot; \
/path/projects/p1 \
/path/projects/p2
</pre>
<p>That is &#8230;.<br />
Line 1 &#8211; start tracd for a given hostname and port,<br />
Line 2 &#8211; specify auth for all projects (*), the auth file and the &#8220;Realm&#8221; you specified when creating the file with apache&#8217;s htdigest command<br />
Lines 3+ &#8211; specify as many projects as you want to run</p>
<p>This is ok with a couple of projects, but gets unwieldy quite quickly.  What I needed was a little shell script to open up all projects under a given directory quickly.  Here&#8217;s what I came up with:</p>
<pre class="brush: bash">
#!/bin/bash

# make / truncate a temp file to store names:
temp=/tmp/tracdpaths
&gt; $temp

# specify base directory:
base=/path/projects/

# output all subdirectories to temp file:
find $base -maxdepth 1 -mindepth 1 -type d \
-exec echo -n &quot;{} &quot; &gt; $temp \;

# now start tracd
tracd --hostname=webhost.com -p 9876 \
--auth=&quot;*,/path/projects/people.htdigest,Realm&quot; \
`cat $temp`
</pre>
<p>Essentially this script uses &#8216;find&#8217; to get all of the directories exactly 1 level down from your projects directory, and will echo their paths to a temp file (suppressing the newlines).  It will then run run tracd, appending the contents of this file to the end of the call.</p>
]]></content:encoded>
			<wfw:commentRss>http://otaqui.com/blog/600/bash-script-for-serving-multiple-trac-projects-and-sharing-authentication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Custom User Agent with Cucumber Tests and Webrat in Mechanize Mode</title>
		<link>http://otaqui.com/blog/541/custom-user-agent-with-cucumber-tests-and-webrat-in-mechanize-mode/</link>
		<comments>http://otaqui.com/blog/541/custom-user-agent-with-cucumber-tests-and-webrat-in-mechanize-mode/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 12:08:50 +0000</pubDate>
		<dc:creator>pete</dc:creator>
				<category><![CDATA[Professional]]></category>
		<category><![CDATA[cucumber]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[testing]]></category>
		<category><![CDATA[webdev]]></category>

		<guid isPermaLink="false">http://otaqui.com/blog/?p=541</guid>
		<description><![CDATA[It&#8217;s pretty straightforward to set a custom user agent with mechanize if you&#8217;re using it directly, KickAssLabs has a good example. If you&#8217;re using Mechanize through Webrat though, things are a little different. The nice thing though, is that you can do this in a step definition &#8211; allowing features to be based on different [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s pretty straightforward to set a custom user agent with mechanize if you&#8217;re using it directly, <a href="http://www.kickasslabs.com/2009/03/31/quick-hits-setting-the-user-agent-header-in-webrat/">KickAssLabs has a good example</a>.</p>
<p>If you&#8217;re using Mechanize through Webrat though, things are a little different.  The nice thing though, is that you can do this in a step definition &#8211; allowing features to be based on different browser scenarios (this is great if you&#8217;re developing across devices).</p>
<p>First off there are two accessors of interest in mechanize, &#8220;user_agent&#8221; and &#8220;user_agent_alias&#8221;.  The former is fairly self evident and lets you define the user agent at will, the latter gives you shortcut access to a list of common user agents baked into mechanize.  You can see that list in <a href="http://github.com/tenderlove/mechanize/blob/master/lib/mechanize.rb#L48">the mechanize.rb source</a>.  It contains some desktop browsers, the iPhone and the default Mechanize UA strings.</p>
<p>If you&#8217;re happy with the default alias list, you can just write a step definition like this:</p>
<pre class="brush: ruby">
Given /^I am using the &quot;(.*)&quot; browser$/ do |browser|
  webrat.adapter.mechanize.user_agent_alias = browser
end
</pre>
<p>And then you can use this in your features:</p>
<pre class="brush: text">
Given I am using the &quot;iPhone&quot; browser
When I visit the home page
Then I should see &quot;You are using an iPhone!&quot;
</pre>
<p>If you want to be able to specify your own UA strings, and as I said this is especially likely if you are developing cross-device applications where capabilities are important, then you can just use your own hash instead, and set &#8220;user_agent&#8221; rather than &#8220;user_agent_alias&#8221;:</p>
<pre class="brush: ruby">
Given /^I am using the &quot;(.*)&quot; browser$/ do |browser|
  UA_ALIASES = {
    &quot;Nokia N95&quot; =&gt; &quot;Mozilla/5.0 (SymbianOS/9.2; .....&quot;,
    &quot;Palm Pre&quot; =&gt; &quot;Mozilla/5.0 (webOS/1.0; .....&quot;
  }
  webrat.adapter.mechanize.user_agent = UA_ALIASES[browser]
end
</pre>
<p>With a little tweaking you could use both the included list and, if the string from your feature isn&#8217;t there, look in a custom list too.</p>
]]></content:encoded>
			<wfw:commentRss>http://otaqui.com/blog/541/custom-user-agent-with-cucumber-tests-and-webrat-in-mechanize-mode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Complete List of Special Google Chrome URLs</title>
		<link>http://otaqui.com/blog/539/complete-list-of-special-google-chrome-urls/</link>
		<comments>http://otaqui.com/blog/539/complete-list-of-special-google-chrome-urls/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 20:12:54 +0000</pubDate>
		<dc:creator>pete</dc:creator>
				<category><![CDATA[Professional]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[webdev]]></category>

		<guid isPermaLink="false">http://otaqui.com/blog/?p=539</guid>
		<description><![CDATA[Google Chrome has quite a lot of special URLs. Some of these are covered over at Lifehacker in their post on Chrome&#8217;s about pages, but the meta &#8220;about:&#8221; protocol isn&#8217;t the only one that Chrome uses. Waha, a user on the chromeplugins.org site posted a much more complete list of URL schemes that Chrome uses. [...]]]></description>
			<content:encoded><![CDATA[<p>Google Chrome has quite a lot of special URLs.  Some of these are covered over at Lifehacker in their <a href="http://lifehacker.com/5045164/google-chromes-full-list-of-special-about-pages">post on Chrome&#8217;s about pages</a>, but the meta &#8220;about:&#8221; protocol isn&#8217;t the only one that Chrome uses.</p>
<p>Waha, a user on the chromeplugins.org site posted <a href="http://www.chromeplugins.org/google/chrome-tips-tricks/about-chrome-more-internal-urls-7793.html">a much more complete list of URL schemes</a> that Chrome uses.  Waha was looking at the <a href="http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/url_constants.cc">url_constants.cc</a> source file, along with some other stuff, to work this list out.</p>
<p>I&#8217;ve ignored the virtually universal set of protocols that are in just about every browser: http, https, ftp, file, data, feed and javascript, and also the URLs that cannot be entered into the address bar (not using Chrome 5 on OS X Snow Leopard anyway).</p>
<p>Without further ado, here&#8217;s the list:</p>
<ul>
<li><a href="about:blank">about:blank</a> &#8211; the empty page</li>
<li><a href="about:cache">about:cache</a> &#8211; disk and memory cache information</li>
<li><a href="about:net-internals">about:net-internals</a> &#8211; network information including Proxy, HostResolver, URLRequest, HTTPCache and SocketStream</li>
<li><a href="about:crash">about:crash</a> &#8211; the page shown when a tab process crashes</li>
<li><a href="about:credits">about:credits</a> &#8211; list of libraries and other code used in Chrome, with links</li>
<li>about:hang &#8211; this seems to kill a tab for me (I haven&#8217;t linked for that reason &#8211; use at your own risk)</li>
<li><a href="about:memory">about:memory</a> &#8211; memory usage of the various processes</li>
<li>about:shorthang &#8211; see about:hang above</li>
<li><a href="about:terms">about:terms</a> &#8211; Google Chrome Terms of Service</li>
<li>about:inducebrowsercrashforrealz &#8211; not many lolz here</li>
<li><a href="chrome://extensions/">chrome://extensions/</a> &#8211; installed extensions</li>
<li><a href="chrome://history/">chrome://history/</a> &#8211; your browsing history</li>
<li><a href="chrome://newtab">chrome://newtab</a> &#8211; the new tab page</li>
<li><a href="chrome://thumb/http://www.google.com/">chrome://thumb/http://www.google.com/</a> &#8211; thumbnail for a page you&#8217;ve visited</li>
<li><a href="chrome://favicon/http://www.google.com/">chrome://favicon/http://www.google.com/</a> &#8211; favicon for a page you&#8217;ve visited</li>
<li><a href="view-source:http://otaqui.com/blog/539/complete-list-of-special-google-chrome-urls">view-source:http://otaqui.com/blog/539/complete-list-of-special-google-chrome-urls</a> &#8211; view the source of a web page</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://otaqui.com/blog/539/complete-list-of-special-google-chrome-urls/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

