lukebaker.org

lukebaker.org

Archive for the ‘Projects’ Category

Disc Golf Courses By County

with one comment

With a healthy blanket of snow still on the ground, I took on an indoor disc golf project this weekend.  I’ve been wondering about the distribution of golf courses across the country, so after downloading some data on disc golf courses I created a map of all the disc golf courses in the USA by county.

 

Original SVG

Hat tip: How to Make a US County Thematic Map Using Free Tools

Written by Luke

March 8th, 2011 at 5:39 pm

SmugMug Tweaks

without comments

SmugMug Admin Rating Sample

Lately, I’ve been working on some SmugMug tweaks to take advantage of their offer of a free lifetime account for developers who use their API. The first one was a quick hack which uploads some recent SmugMug photos to your Flickr account. This allows people who switched to SmugMug to still keep up with their Flickr network. More information is available on the project’s page.

The second and more interesting one is some JavaScript that adds the ability for SmugMug users to rate their own photos. This is the first of two projects to aid my work flow. Eventually I want to be able to upload a bunch of photos in a private album, rate them, and then in one fell swoop move all photos with a rating higher than X to a public album.

I provide two installation options which both pull the script from my server and inject it into the pages. This should allow for invisible upgrades. Savvy or cautious users can install it other ways.

Another interesting aspect of this project is its integration with SmugMug’s API. First, we’re using the API on SmugMug’s own site. This isn’t the typical use case of a photo site’s API. Secondly, the script gets proper API authorization behind the scenes, without asking the user for any information. Provided that the user is already logged in to SmugMug’s site, then my script gains that user’s credentials when interacting with API. This is not evident in the API docs and requires a bit of a hack.

Any users should be aware of security concerns whenever external JavaScript is inserted into your page.  Protect yourself as you see fit.

Written by Luke

December 17th, 2007 at 1:02 pm

ActiveRecord in PHP

with 3 comments

I’ve been meaning to release this code for quite some time. I’ve finally had a bit of time and motivation to sit down and take care of it. Ever since I started working with Ruby on Rails, I would cringe whenever I had to write yet more PHP code to do simple CRUD actions. Furthermore I really enjoyed the Rails syntax that you use to interact with its implementation of the ActiveRecord pattern. As such, I went forward and built a clone using PHP5. So far it has been used for a few projects and has been a joy to use.

Props to my employer, Gospel Communications, who allowed me to spend some time on this during work hours, as well as give me full copyright of the code.

More information and documentation over on the project’s home page.

Written by Luke

September 24th, 2007 at 6:25 pm

Search Along A Driving Route

with 8 comments

I recently went on a 3000 mile road trip, and as I was preparing for the trip, I wanted to know the answer to questions like “Where are all the Speedway gas stations that are within a mile of my route?”. I couldn’t find anything that would allow me to search for businesses near a given driving route, instead I could only search for things near a given point or city. I decided to build a mashup using Yahoo! Pipes and Google Maps that would allow me to do just what I wanted.

How to use it:

  1. Install the search-route bookmarklet.
  2. Go to Google Maps and create route.
  3. Click the search-route bookmarklet you installed in step #1.
  4. Search!

If you don’t want to bother installing the bookmarklet and want to try out the searching, you can test a local driving route or a long distance driving route.

How it Works:

After the user creates the route on Google Maps, clicking the bookmarklet sends the URL of their Google Maps page to a script on my site. This script will download the URL from Google Maps and parse out the encoded route in that page. Once we have this, we can give the user a search page with their route and map using Google Maps’ API. When the user searches, we call a Yahoo! Pipe which is passed the search parameters and a special id referencing this user’s route. The Yahoo! Pipe will download a specially crafted Atom feed for this route from my server. This Atom feed contains a list of some of the latitude and longitude points of the route. The Yahoo! Pipe then does a Yahoo! Local search on each point using the search parameters the user specified. Searches on particularly long routes can take several seconds to complete.

Written by Luke

April 19th, 2007 at 3:23 pm

Posted in General,Projects

Source Code Management

with one comment

I’ve never used a source code management system for any personal projects. However, I just started using subversion after (1) hearing a lot of good stuff about it at OSCON2005 and (2) reading the first few chapters of Pragmatic Programmer, The: From Journeyman to Master, which strongly encourages using a SCMS for every single line of code you write.

I’ve immediately found reassurance in having my project in subversion. I don’t have to worry that a change I make might be hard to reverse. I can always revert to a previous revision. I’d definitely recommend using a SCMS for all your code. I’m still trying to figure out how to organize all my code to be kept in subversion, including any “throw away” scripts.

By the way, I’d highly encourage anyone who does any coding or application design to read Pragmatic Programmer, The: From Journeyman to Master. I’m about halfway through, and it’s quite good. It feels like the sort of book that you’d want to keep around and occasionally go back to, just to refresh your mind and get a new perspective on whatever project you’re working on.

Written by Luke

September 13th, 2005 at 9:06 pm

Posted in General,Projects

Gmail Greasemonkey Update

with 3 comments

Wow, go me! I managed to dork up my site for awhile. :-/ Well I updated my Gmail greasemonky script to work properly even when changing between multiple Gmail accounts. Gmail changed something awhile ago, and I was slow to update the version on the site. It’s there now.

Written by Luke

August 18th, 2005 at 3:33 pm

Posted in General,Gmail,Projects

Gmail Changes Breaking Stuff

with 5 comments

Google decided to change the domain and URL syntax of Gmail:

  1. gmail.google.com redirects to mail.google.com
  2. instead of URLs like /gmail?param they look like /mail/?param

My persistent searches script has been updated to work with these changes. I would recommend uninstalling the original script and then installing the updated version.

Written by Luke

June 21st, 2005 at 5:56 pm

Posted in General,Gmail,Projects

Gmail Bug Part 2

with one comment

It appears that the issue is that behind the scenes (or at least relating to search and filters), labels apply to individual messages. Apparently when a filter is set to add a label, it will add that label to the message, and not to the conversation that the message is a part of. This is the only way that different messages in the same conversation may be labeled differently. Every other interface that Gmail provides to the label functionality relates to conversations, not messages. This turns out to be annoying. :-/

Written by Luke

June 10th, 2005 at 11:06 am

Posted in General,Gmail

Gmail Bug

with 2 comments

I’m using Gmail a lot more recently (more later), however I’ve found an annoying bug. I’m now forwarding all my messages to a non-Gmail account to Gmail. All of these are given a label to indicate that they came to that non-Gmail account. They are also optionally given additional labels depending on if they have certain subjects, recipients, or content. I want to be able to do a search for any messages that only have the initial label that indicates that this email came through my non-Gmail account. For instance, if I label all my bills as “bills” and all emails from my gas company as “gascompany”, then some emails may be labeled both “bills” and “gascompany”. However, when I do a search like [label:bills -label:gascompany], I sometimes will get messages that are labeled both “bills” and “gascompany”. For those that are showing up in my results (but shouldn’t be), I can manually give them the “gascompany” label (again) and they won’t show up in the results if I do the same search again. Here’s proof: Example of Gmail Bug

Written by Luke

June 9th, 2005 at 8:31 am

Posted in General,Gmail

Nutch and Bittorrent

without comments

Cool. The new bittorrent search engine uses Nutch.

Written by Luke

May 25th, 2005 at 8:31 pm

Posted in General,Nutch