Geeky Articles RSS Feed http://mbauman.net/rss/geek/ 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="http://s3.amazonaws.com/static.mbauman.net/page_attachments/166/fancyicon2.png" alt="" /></a></p> <p>Back when I <a href="http://mbauman.net/geek/2009/08/06/iphone-geolocation-bookmarklets/">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="http://heavens-above.com">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="http://mbauman.net/iss">http://mbauman.net/iss</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 http://mbauman.net/geek/2011/07/02/tracking-the-iss/ http://mbauman.net/geek/2011/07/02/tracking-the-iss/ Finer zoom increments in WebKit <p style="float:right"><a href="http://s3.amazonaws.com/static.mbauman.net/page_attachments/160/SafariViewMenu.png"><img src="http://s3.amazonaws.com/static.mbauman.net/page_attachments/162/SafariViewMenuSmall.png" 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="http://webkit.org/">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/WebView.mm</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="https://gist.github.com/770529">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 WebKit.app 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 WebKit.app 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 http://mbauman.net/geek/2011/01/07/finer-zoom-increments-in-webkit/ http://mbauman.net/geek/2011/01/07/finer-zoom-increments-in-webkit/ iPhone Geolocation Bookmarklets <p style="float:left"><a href="http://s3.amazonaws.com/static.mbauman.net/page_attachments/156/IMG_0010.PNG"><img src="http://s3.amazonaws.com/static.mbauman.net/page_attachments/158/IMG_0010_240.png" 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="http://heavens-above.com">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='http://www.heavens-above.com/?lat='+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="http://www.heavens-above.com/?lat="+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='http://www.heavens-above.com/?lat='+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='http://forecast.weather.gov/MapClick.php?lat='+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="http://forecast.weather.gov/MapClick.php?lat="+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 http://mbauman.net/geek/2009/08/06/iphone-geolocation-bookmarklets/ http://mbauman.net/geek/2009/08/06/iphone-geolocation-bookmarklets/ Minor Truetype Font Editing on a Mac <p style="float:left"><img src="http://s3.amazonaws.com/static.mbauman.net/page_attachments/150/cfonts.png" 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="http://www.wezm.net/2009/03/03/install-consolas-mac-osx/">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="http://www.codinghorror.com/blog/archives/000884.html">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="http://s3.amazonaws.com/static.mbauman.net/page_attachments/154/icons.png" 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 http://mbauman.net/geek/2009/03/15/minor-truetype-font-editing-on-a-mac/ http://mbauman.net/geek/2009/03/15/minor-truetype-font-editing-on-a-mac/ 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="http://www.mcetech.com/"><span class="caps">MCE</span> Technologies</a> sells a decent-looking package called <a href="http://www.mcetech.com/optibay/">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 http://mbauman.net/geek/2007/05/26/adding-an-optibay-to-my-macbook-pro/ http://mbauman.net/geek/2007/05/26/adding-an-optibay-to-my-macbook-pro/ 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 http://mbauman.net/geek/2007/05/12/new-site/ http://mbauman.net/geek/2007/05/12/new-site/