Chrome Extension for Redirecting URLs/Domains

I was annoyed that I repeatedly entered the wrong domain into Chrome's omnibox when I wanted to visit openstreetmap.de. So I searched for a workaround and it turned out the easiest way to redirect a domain permanently to another domain is a redirect in your browser.

Google was helpful as always and I found this raw extension. It's probably one of the simpliest Chrome extensions possible, consisting of three files with basic HTML, JSON and Javascript.

To make it work for me I only had to motify content.js like this:

var osmde = /osm.de/

var newurl

if (window.location.href.match(osmde))  // redirect from osm.de to openstreetmap.de

    {

      newurl = window.location.href.replace(osmde,"openstreetmap.de");

    }

chrome.extension.sendRequest({redirect: newurl}); // send message to redirect

So if the URL matches osm.de, it will redirect to openstreetmap.de.

You can either copy&paste the 2 files from the aforementioned link and my content.js above or download the whole thing as a .zip here.

Install_extension

The installation is simple, open the Extension tab and activate the developer mode. Click on "Load unpacked extension" and select the folder with the 3 files.

If someone repackages this whole thing into a full Chrome extension with a simple interface for adding redirects, let me know.

 

Finder Toolbar Icons and Buttons

Finder_toolbar_kopie

I usually organize my files in project folders and often create a file called notes.txt to add some ideas, to-dos or meta data for the project. This used to require several clicks and commands, so I was looking for a faster way to do that.

A quick Google search later I found this great AppleScript app by Jonas Wisser. After you press the button, it'll ask you for a filename, create filename.txt and open the file in your default text editor.

Bildschirmfoto_2011-12-23_um_16

Since I only want to create a file called notes.txt, I quickly edited the Apple Script app to skip the custom filename part, making the whole process even faster. Luckily the AppleScript app even recognizes existing files and instead of overwriting them simply opens them up.

I now had a almost perfect solution, except for the lack of an icon. The AppleScript logo just looked ugly and non-descriptive in my Finder toolbar.

I'm going to spare you a repetition of all the mistakes and things I had to try to make this work and only describe how you can assign a custom icon to an AppleScript app on Mac OS X (Snow Leopard in my case).

First you have to create your logo; for the Finder toolbar you go with a 32x32 image. Here's an empty button that you can use. Once you've added some custom pixels for your icon, export it as a PNG file.

Next you'll need Icon Composer, that is part of the Apple Dev tools (XCode). You need to create a new icns file and drag and drop your PNG button in all 5 areas. Then save this icns file.

Icon_composer_button_kopie

Unfortunately you can't use this icns file just yet, because it's intended to be compiled with a complete app through XCode.

To get around this we use IconDroplet by Zach Weigand. Start IconDroplet and drag your icns file onto the icon in the dock. This will create a new file that doesn't have a filetype extension since it's actually an app (be warned, the app will have a date in February 2009 as its creation date, so it might be somewhere way down in your Finder window).

Now you select this app (here's mine with my NewTextFileHere icon) and press CMD+I. In the Info window you select the icon in the top left and copy it. Then you do Get Info on your target AppleScript app, select the icon in the top left and simply paste the icon.

Drag the app into your Finder toolbar and you should be done.

 

A Fresh Look for OpenStreetMap.de

Last weekend Pascal and Fabian with a little help from me relaunched openstreetmap.de. The previous visual and information design was not only 3 years old, but had become crowded and in my opinion ugly:

Old_osmde
I spent some time thinking about what information should be presented on the site and where the focus should reside. We collectively agreed that openstreetmap.de should primarily present information for first time visitors and new OpenStreetMap users or contributors. To differentiate it from osm.org and the OSM wiki, all information should be presented in German and with as little clutter as possible.

Naturally the most important points and questions would be answered at the top and the rest would follow with declining priority. I’m currently a fan of long pages that encourage scrolling, so I had no issues with limited space. I also made a point of not including a map on the homepage to very clearly show that OpenStreetMap is not merely a GoogleMaps clone.

Here’s what I came up with after a few iterations (click here for 100%).

Osm-de_home_v3-2_kopie
You may notice how the content is pretty similar to what was present on the old site. I decided to go this way to save some time by not rethinking every sentence and to make porting the old site over to the new design easier.

Unfortunately I didn’t have enough time to implement the new layout all by myself without waiting for a few more months, so I asked for help and Fabian and Pascal gladly offered to take a look. They made some more adaptations and simplifications to the layout and quickly got a working prototype by using Bootstrap (which is pretty awesome by the way).

And after a few more iterations and feedback the site launched this past Saturday morning looking like this.

Osmde_new
Luckily the OSM community has mostly liked the redesigned site and the feedback was overly positive. There were a few people asking for rainbows and unicorns as always, but there was also quite a bit of very useful feedback. I set down with Pascal to talk through all the feedback and we decide what to implement and what to ignore. I made a point of responding to almost everyone explaining why we decided to not do certain things. When I give feedback or beta test something, I'm always disappointed when I don't get a response to my suggestions, so I did want to do this the right way.

All the suggestions that we liked and fit into the concept are already implemented and live by now. The website is available in the OSM.org SVN for everyone's contribution and changes are pulled by a few trusted persons on the web server.

Since the website is only built using simple HTML, CSS, Javascript and Bootstrap to make things easier, I hope that it will keep getting updates as OSM grows and evolves. Bootstrap continues to improve and will soon add responsive design capabilities, so this could be a first point to polish a few remaining things.

You can read Pascal's take on the launch here.

 

Homebrew's 'brew doctor' – edit .bashrc

Homebrew for Mac OS X is awesome. I could write a whole blogpost about it, but that's certainly not the purpose of this post. If you ever use or want to use command line tools like wget or ffmpeg that are not included in Mac OS X by default, you should definitely check out Homebrew.

If you run into problems with Homebrew it will always suggest to you to run 'brew doctor', which will check your Homebrew installation for common problems. For me, it looked like this:

  Jonas$ brew doctor
  /usr/bin is in your PATH before Homebrew's bin. This means that system-
  provided programs will be used before Homebrew-provided ones. This is an
  issue if you install, for instance, Python.

  Consider editing your .bashrc to put:
    /usr/local/bin
  ahead of /usr/bin in your $PATH.

  Some brews install binaries to sbin instead of bin, but Homebrew's
  sbin was not found in your path.

  Consider editing your .bashrc to add:
    /usr/local/sbin
  to $PATH.

Now, obviously I started googleing on how to edit my .bashrc, but I didn't really find a good tutorial on the first try, that's why I'm writing this one. After some more searching around I was able to figure out a solution that I'll explain below.

On a standard Mac OS X Snow Leopard installation you won't have a .bashrc file. However you should have a .profile file which does similar things. Here's an article about the difference between .bashrc, .bash_profile and .profile files (the comments on that article provide some further clarification).
From what I understand it's best to edit .profile in your home folder. To do this, start Terminal and type

open -t ~/.profile

This will open .profile with your default text editor.

Then add the following line (the file might be empty so far):

  export PATH="/usr/local/bin:$PATH:/usr/local/sbin"

Restart Terminal, run 'brew doctor' again and everything should be fine.

A short explanation on how that works: To see your current PATH you can run 'echo $PATH'. The command above in .profile now simply puts '/usr/local/bin' in front of your PATH and '/usr/local/sbin' at the end of it and sets it as your new PATH.

Eine neue „Willkommen bei OpenStreetMap“-Seite

Die meisten, die das hier lesen, werden sich vermutlich nicht mehr erinnern. Irgendwann seid ihr einmal genug von OSM begeistert gewesen, dass ihr beschlossen habt euch ein Benutzerkonto anzulegen. Wie bei Webservices üblich habt ihr danach eine E-Mail mit Bestätigungslink erhalten, diesen angeklickt und dann ?

Alte_email

In der E-Mail steht mittlerweile eine Menge Text mit einer Menge Links. Die meisten werden nur auf den Link zum Bestätigen geklickt haben, manche haben vielleicht auch den unübersichtlichen Text darunter gelesen und haben damit zumindest ein paar grobe Anhaltspunkte bekommen, wie sie weiter machen sollen. Da dieser Text aber über die Jahre immer weiter gewachsen ist, fehlte im Struktur und Einheitlichkeit, teils auch Aktualität.

Spätestens jetzt sollte klar sein, dass diese Situation nicht optimal war und besser gelöst werden konnte. Den Text in der E-Mail übersichtlicher zu strukturieren wäre möglich gewesen, allerdings durch die Beschränkungen des E-Mails-Format nur in gewissen Grenzen. Das Problem, dass viele den Text gar überlesen und direkt den Bestätigungslink anklicken wäre überhaupt nicht gelöst worden.

Die beste Lösung war es daher eine spezielle Seite zu basteln, ausgehend von folgender Überlegung: Jemand ist begeistert genug sich bei OSM zu registrieren und möchte nun vermutlich mit dem Eintragen und Ändern von Daten loslegen.

Willkommen_bei_openstreetmap

Die „Willkommen bei OpenStreetMap“-Seite beginnt daher mit Links zu den wichtigsten Wiki-Seiten zum Thema Datenerfassung und den Editoren. Damit sich der „Neuling“ Hilfe von anderen OSM-Mitwirkenden holen kann und mit der Community in Kontakt treten kann werden sowohl die verschiedenen Kommunikationskanäle als auch die lokalen Gruppen erwähnt. Das Wiki als zentrale Informationsquelle wird ebenso vorgestellt; zusätzlich der Hinweis, dass man für die Bearbeitung des Wikis leider noch ein Benutzeraccount anlegen muss. Am Ende schließlich werden dem Besucher Blogs und Twitter-Links gezeigt, damit er auch in Zukunft von aktuellen Änderungen bei OSM erfährt und einen weiteren Eindruck des Projektes bekommt.

Diese Informationen bieten einen guten Einstieg zum Anfang mit jeweils weiterführenden Links auf den verlinkten Seiten. Die übersichtliche Präsentation der Informationen wäre so in einer E-Mail kaum zu erreichen gewesen.

User

Um auch die neuen Benutzer zu erreichen, die die E-Mail nicht ganz lesen, wird die Seite zusätzlich auf osm.org nach der Bestätigung des Benutzerkontos erwähnt. Alle die, die die E-Mail löschen und die Seite nicht als Lesezeichen abspeichern, können sie zusätzlich auch auf openstreetmap.de als Link finden.

Neue_email_entwurf

Hinweis: zum Zeitpunkt der Veröffentlichung des Blogposts existiert die E-Mail in der neuen Form wegen technischer Schwierigkeiten bei der Implementierung noch nicht. Für Hilfe von Leuten, die sich mit Rails (genutzt für osm.org) auskennen, bin ich dankbar.

Indem die Seite nur in der deutschen Version von osm.org verlinkt ist, bekommen alle anders-sprachigen OSM-Mitwirkende weiterhin die alte E-Mail zu sehen. Es wäre sicher wünschenswert, dass die Seite auch in anderen Sprachen verfügbar gemacht wird, allerdings wird es mit einer einfachen Übersetzung nicht getan sein, denn auch die verlinkten Seiten müssen in der jeweiligen Sprache oder zumindest in Englisch verfügbar sein.

Da die Seite auf openstreetmap.de gehostet wird, ist sie auch im OSM-SVN zu finden und kann leicht auf dem aktuellen Stand gehalten werden. Insgesamt besteht die Seite nur aus relativ einfachem HTML und CSS sowie einigen Icons.

Early-prototype

Einer der ersten Entwürfe

Bei meiner „Recherche“ für diese Seite ist mir aufgefallen, dass es mittlerweile eine beachtliche Zahl an Wiki-Seiten zu Einsteiger-Themen gibt. Leider sind diese Seiten oft mit sehr viel Text überfrachtet und grenzen sich nicht klar von einander ab. Auch mangelt es an deutschsprachigen Videos, die Editoren und ähnliches erklären, aber nicht zu sehr veraltet sind. Wenn ihr an einem dieser Themen arbeitet und dort Verbesserungen erzielt, lasst es mich wissen und ich kann gegebenenfalls die Seite mit einem neuen Link versehen.

Ich habe noch ein viele Kleinigkeiten, die ich noch an der Seite verbessern möchte, aber diese sind so geringfügig, dass sie auch nach dem „Start“ der Seite durchgeführt werden können.

Ich hoffe, dass die Seite einen Fortschritt bei der Benutzerfreundlichkeit von OpenStreetMap darstellt und insbesondere neuen Mappern den Einstieg erleichtert.

Danke an Jochen, Patrick, Michael und Stephan für das hilfreiche Feedback.