Geeky Articles RSS Feed en-us 40 The RSS feed of just my geeky posts. No sense of reality here. Tracking the ISS <p style="float:right"><a href="/iss"><img src="" alt="" /></a></p> <p>Back when I <a href="">wrote about creating iPhone bookmarklets that automagically grab <span class="caps">GPS</span> location</a>, I lamented that you&#8217;re unable to easily bookmark them within an iOS device or save them as web apps. A few friends were pestering me about the using the <span class="caps">GPS</span>-enabled <a href="">Heavens Above</a> link to track the <span class="caps">ISS</span>, so I quickly threw together something here on my website. The webpage <a href=""></a> will simply request your location and forward you on to Heavens Above&#8217;s <span class="caps">ISS</span> tracking page.</p> <p>The page itself is extraordinary simple. It uses entirely client-side processing; no data is logged. I only use your location to point to the correct <span class="caps">URL</span> to Heavens Above. The only little bit of fanciness involved is that it detects if you&#8217;re on an iPhone or iPod and then displays instructions on how to add to your homescreen. There&#8217;s a nice homescreen icon to go along with it. That said, it also works quite nicely with relatively advanced desktop browsers.</p> Sat, 02 Jul 2011 17:41:32 GMT Finer zoom increments in WebKit <p style="float:right"><a href=""><img src="" alt="" /></a></p> <p>I&#8217;ve always been annoyed at how large the jumps are between zoom increments in every single web browser. One click of &#8220;Zoom In&#8221; and suddenly the text is <span class="caps">HUGE</span>. I have found it so unhelpful in the past that I had completely forgotten about the feature. But then two things changed:</p> <ol> <li>I purchased a high resolution laptop. I really like the display, but it can make text on some websites too small to read comfortably.</li> <li>Apple made <em>zoom in</em> a built-in gesture on their trackpads. In almost all applications, the &#8220;pinch&#8221; and &#8220;stretch&#8221; gestures gradually zooms the content in and out. In Safari, however, the jump between zoom levels is so large that the zoomed page feels jarringly disjointed from the original.</li> </ol> <p>Fortunately, WebKit is open source and anyone can <a href="">download and modify the source code</a>. And it&#8217;s an extremely simple change (as it should be). In file <code>WebKit/mac/WebView/</code>, change</p> <p><code>#define ZoomMultiplierRatio 1.2f</code></p> <p>to:</p> <p><code>#define ZoomMultiplierRatio 1.06265857f</code></p> <p>To be more precise, you may use <a href="">this diff file</a> as a patch. Why <code>1.06265857f</code>? It&#8217;s the cube root of 1.2. Since the current zoom level is computed by multiplying by this ratio, using the cube root effectively makes the zoom increment a third of what is previously was.</p> <p>To compile your very own modified WebKit, go to <code>WebKit/ Tools/Scripts</code> and run <code>./build-webkit --release</code> (it takes a while &#8211; about 40 minutes for me). To use it, open and compile <code>WebKit/Tools/WebKitLauncher/WebKitLauncher.xcodeproj</code> in Xcode. This creates the that is found in the nightly builds. But you&#8217;re not done yet. You need to add your custom-built webkit into this app. Navigate into the build directory and right-click on to Show Package Contents. You need to create the directory <code>Contents/Frameworks/10.6</code> (or <code>10.5</code> if you&#8217;re still on Leopard). Finally, copy all the items from <code>WebKit/WebKitBuild/Release</code> into that new folder, and you&#8217;re done!</p> <p>Now if only I could hack Safari to not require such a large gesture to zoom in&#8230; but alas that code resides in Apple&#8217;s closed source.</p> Fri, 07 Jan 2011 21:47:00 GMT iPhone Geolocation Bookmarklets <p style="float:left"><a href=""><img src="" alt="" /></a></p> <p>Very few websites have implemented the new javascript <span class="caps">GPS</span> geolocation features that were intruduced with <span class="caps">HTML 5</span>. However, there are a few sites that use latitude and longitude directly in their URLs.</p> <p>I first wanted a quick way to get my current latitude and longitude while looking at <a href="">Heavens Above</a>. It&#8217;s a great site that allows you to find visible satellites based upon your current location. Here&#8217;s <a href="javascript:navigator.geolocation.getCurrentPosition(function(g){c=g.coords;z=c.altitude;z=z?z:0;d=new%20Date(2009,0,1,0,0,0,0).toLocaleString().substr(-3,3);window.location=''+c.latitude+'&#38;lng='+c.longitude+'&#38;alt='+z+'&#38;loc=iPhone&#38;tz='+d;},function(){alert('Permission%20denied.')});">the bookmarklet</a> that I created:</p> <div> <code style="word-wrap:break-word">javascript:navigator.geolocation.getCurrentPosition(function(g){c=g.coords;z=c.altitude;z=z?z:0;d=new Date(2009,0,1,0,0,0,0).toLocaleString().substr(-3,3);window.location=""+c.latitude+"&#38;lng="+c.longitude+"&#38;alt="+z+"&#38;loc=iPhone&#38;tz="+d;},function(){alert("Permission denied.")});</code> </div> <p>Copy <a href="javascript:navigator.geolocation.getCurrentPosition(function(g){c=g.coords;z=c.altitude;z=z?z:0;d=new%20Date(2009,0,1,0,0,0,0).toLocaleString().substr(-3,3);window.location=''+c.latitude+'&#38;lng='+c.longitude+'&#38;alt='+z+'&#38;loc=iPhone&#38;tz='+d;},function(){alert('Permission%20denied.')});">this link to your bookmarks</a> and when accessed on an iPhone or location-aware web browser, it will directly load the site with your current location entered!</p> <p>I had to jump through several hoops here. When the altitude is not available (when only using cell-tower triangulation), the javascript code returns <code>null</code>. The website only supports numeric values, so <code>z=z?z:0</code> replaces the <code>null</code> with a <code>0</code>. Secondly, the website needs the local timezone, but unfortunately it only accepts a small subset of the three letter codes (and not the numeric offset from <span class="caps">UTC</span>). Even worse, the daylight savings version of the code (EDT/CDT/MDT/PDT) are unsupported &#8211; the site just assumes that you follow the trend (sorry Arizona). So I grab the code from January 1, 2009 (when daylight savings is not in effect), and parse the three letter code from that string.</p> <p>For most sites, you&#8217;d only need something of the form (<a href="javascript:navigator.geolocation.getCurrentPosition(function(g){c=g.coords;window.location=''+c.latitude+'&#38;lon='+c.longitude;},function(){alert('Permission%20denied.')});">The <span class="caps">NOAA</span>&#8217;s weather forecast</a> , for example):</p> <div> <code style="word-wrap:break-word">javascript:navigator.geolocation.getCurrentPosition(function(g){c=g.coords;window.location=""+c.latitude+"&#38;lon="+c.longitude;},function(){alert("Permission denied.")});</code> </div> <p>Now if only I could find a way to save the javascript bookmark to the Home Screen, I&#8217;d be set!</p> Thu, 06 Aug 2009 01:33:15 GMT Minor Truetype Font Editing on a Mac <p style="float:left"><img src="" alt="" /></p> <p><em>Update December 5, 2011: Changed download link to the most recent version of Apple Font Tool suite, which is now x86 compatible.</em></p> <p>With the release of Windows Vista, Microsoft included six new fonts that they commissioned for the occasion. They are the new defaults for Vista and Office. They&#8217;ve also made them available for Mac through Office as well as a handful of free (as in beer) utilities. I got them by following <a href="">these instructions</a>.</p> <p>These new modern fonts are explicitly designed for display on computer screens with ClearType. Although Apple has a <a href="">different philosophy on font rendering</a>, the same basic premise is used in <span class="caps">OS X</span>. Besides all that (or, rather, because of it) these fonts are very pretty.</p> <p>But there&#8217;s a problem, and you can see it in the image above. When packaging these fonts up for the Mac, Microsoft goofed on the baseline for Consolas. The icon previews below show it much more obviously.</p> <p style="float:center"><img src="" alt="" /></p> <p>In short: it&#8217;s annoying. And wrong. And the fix is after the break.</p> Sun, 15 Mar 2009 21:36:03 GMT Adding an OptiBay to my MacBook Pro <p>Well, I finally decided to risk voiding my warranty for the luxury of double the disk space. I have a 160GB hard drive installed in my MacBook, but I&#8217;m constantly squeezed for space. I never use my internal CD drive (the last time was over two months ago&#8230; and it was actually my house-mate that needed it), so the thought of occasionally using an external CD drive is much more pleasant than lugging an external HD around all the time.</p> <p><a href=""><span class="caps">MCE</span> Technologies</a> sells a decent-looking package called <a href="">OptiBay</a> for a little too much money that takes the internal optical drive and replaces it with a Hard Drive. You can do it on most any Mac laptop. I searched around online quite a bit for reviews and experiences, but it seems as though nobody has done a formal review. So, I figured I&#8217;d photograph and document my experience as I went.</p> Sat, 26 May 2007 21:14:43 GMT New Site <p>Well, I finally got my act together and put together a website. I have a chronic problem of half-completing projects and then just leaving them languishing. I&#8217;m particularly bad with domain names &#8212; I get an idea for a site and snatch up some witty and apropos domain names&#8230; only to never fully develop the idea into a working site. Part of my problem is that I keep making my plans more and more intricate until it simply becomes impossible for my limited skill-set.</p> <p>The impetus for this site is three-fold (and it therefore will have three sections once completed)...</p> Sat, 12 May 2007 01:49:24 GMT