Writings

Technology, open source, personal essays, and everything that isn't climate.

Fixing Github with Greasemonkey

Github is great, I really can't say enough good things about them.  What's not so great is their css, as it breaks badly if you change you dpi.  I finally found the root cause of this which is the search field gets squeezed vertically, and collides with the div under it, forcing that to the right, and forcing the right sidebar down.  I sent in some feedback, but am not sure if/when it might get applied.

So, in the short term I added the following greasemonkey script for github.com

function addGlobalStyle(css) {
    var head, style;
    head = document.getElementsByTagName('head')[0];
    if (!head) { return; }
    style = document.createElement('style');
    style.type = 'text/css';
    style.innerHTML = css;
    head.appendChild(style);
}

addGlobalStyle('#header .topsearch {width: 25em}');

And voila, the site is readable again.

Related: In praise of github · Where is Io source code up on github · Emacs Tip: Make CSS mode sane

Integer Latitude / Longitude

I was very happy to recently realize that you can put latitude and longitude directly into google maps, and it will give you a map with that marker.  This is really useful if the address gives you a location that isn't right, as you can manually adjust the latitude and longitude to put the marker in the right place.

My parents almost live on the 44 degree lat line (I think the GPS coords for our wedding were 43.9998), so it occurred to me to see where the closest integer Lat / Long was to them, which isn't that far away, though it's close to a mile off any of the local roads.

View Larger Map

I was obviously curious where the closed one was to me, which I've actually been past before. It's also only a couple hundred feet of a road, so easy to get to.

And that made me wonder. What an interesting experiment that would be, to get a photo from ever integer lat / long on the planet, and display it on a website. I've got too many sticks in the fire, so no time for that, but if anyone decides to do it, let me know. I'll contribute a few pictures from the ones I can get to.

Updated: apparently this already exists, my search terms were just wrong the first time.  It's called the Degree Confluence Project.

Related: Tip of the Day: Google Maps styling · How to Use Free GPS Hiking Maps on Android Without Cell Coverage · Google Maps snapshot in time

Why I love Ruby on Rails... impement a new feature in about an hour

Yes, I'm a fanboy, but with good reasons.

Tonight I decided that I'd really like to add openid support to the MHVLUG Event Calendar.  Accounts aren't used that much in it, because you have to be in the admin role to notice any difference.  However, it's just one less field for me to have to fill in.

So, the 6 million dollar question, what was the duration of time between deciding I'd like to do this (though having no idea how), and having a working implementation...

65 minutes.

Which included getting up to get dinner in the oven.

In blow by blow format:

  • A quick bit of googling got me to the openid-authentication railscast, which I watched all the way through.
  • I fixed a couple of his refactoring bits to work with newer restful_authentication.
  • I also installed an old open_id_authentication plugin the first time, which gave me an exception.  Make sure to get the latest on github.
  • I modified my user to have my identity_url using the rails console
  • I used the rails debugger to figure out that I needed an extra slash on the end of my identity_url, which is why my login with openid wasn't working

Which is a pretty serious amount of bouncing around because I had no idea what I was doing when I got started.  That will turn subsequent openid enablement into a 15 minute exercise.

Related: OpenID and Gravatars · Weekend Rails Hacking · How to blow 2 hours on apache, ruby, and rails

Until one is committed, there is hesitancy

Until one is committed, there is hesitancy, the chance to draw back, always ineffectiveness. Concerning all acts of initiative (and creation), there is one elementary truth the ignorance of which kills countless ideas and splendid plans: that the moment one definitely commits oneself, the providence moves too. A whole stream of events issues from the decision, raising in one’s favor all manner of unforeseen incidents, meetings and material assistance, which no man could have dreamt would have come his way. I learned a deep respect for one of Goethe’s couplets: “Whatever you can do or dream you can, begin it. Boldness has genius, power and magic in it!”

W. H. Murray [thx SM]

via the Signal vs. Noise blog (yes, you should go and subscribe to that immediately)

Related: The truth, with pictures · Weekend hacking... much progress · This American Economy

OpenID and Gravatars

... also known as - please don't make me fill out those same 6 fields to get into your website!

A few weeks ago I gave an MHVLUG talk on Ruby on Rails.  At the normal dinner outing afterwards one of our members was talking about maybe creating a small rails application where people could share and publish the podcasts they listen to, which I think is a great idea.  (Hopefully they'll work on it at our web-hack-a-thon.)  But that lead into the inevitable issue of "user accounts".

Man, I hate having more user accounts.  And if we are going to do this project, I really didn't want everyone in the LUG to have to have another one.  So I resolved to see what I could do about reusing the MHVLUG accounts in an external way.  It's actually pretty easy as there is a Mediawiki OpenID extension which lets you go both ways.  You can enable OpenID logins to the wiki, and make people's user pages OpenID providers.  Rails has a very good openid plugin (plus it's integrated as part of the restful-authentication-tutorial) so that would make it trivial to write an application that people can log in using their MHVLUG password (the id will be a bit different, but that's explainable).  While Facebook and Google are still dragging their feet a bit here, Yahoo, AOL, and Wordpress.com are all on the bandwagon, so many people already have these ids, they just don't know it.

That got me following a few threads on OpenID, and looking at Wordpress.  It turns out that Wordpress also has a good OpenID plugin.  What's quite interesting about that plugin is that it can make a wordpress instance the OpenID provider for 1 of the Wordpress users.  So if you have a personal blog, it means you can now very easily be your own OpenID.  Being able to login in as http://dague.net is quite convenient.

Lastly, I wanted to throw something in about gravatars.  You know how everyone wants you to upload your picture to their website?  Stop the madness!  Gravatars are just keyed off your email address, so if an site has that, they can look you up, and get your profile pic from the gravatar folks.  Newer wordpress templates automatically integrate this.  I did minor adjustment to my template to get this support in there.  I've sworn now that Meetup.com is the last people I'm ever uploading a picture for, and that's just because it's hard to find complete strangers in a dinner without photos.  Again, there is a good rails plugin 🔗💀 for this, so it's pretty trivial to integrate if you are doing a Ruby on Rails application.

So, if you are a web2.0 hipster, and thinking about making a new service, please don't make me create a new account, because, honestly, that's getting close to being a deal breaker for me at this point.  And if you want my picture, the gravatar people have it.  I'm not uploading it for you again. :)

Related: Why I love Ruby on Rails... impement a new feature in about an hour · Learning to Love Mediawiki · Weekend Rails Hacking