Archive for August, 2007

Roundcube Domain Autocomplete

I type the phrase “loganrockmore.com” enough as it is; I don’t want to have to type it in when I’m logging into my Roundcube web mail client. So I threw together a quick little hack today that will auto-complete user names on the login screen. So, if I type in “dev” and then hit Tab to go to the password field, it autocompletes to “dev@loganrockmore”. It should work automatically with any different domain and set up, however I haven’t tested it anywhere but my server. If you have issues with it, let me know and I’ll see if I can change it to work.

This was put together with Roundcube 0.1 RC1.1 .

Open program/include/main.inc. On line 1446, replace

$input_user = new textfield(array('name' => '_user', 'id' => 'rcmloginuser', 'size' => 30, 'autocomplete' => 'off'));

with the two lines

$domain = preg_replace("/^www\./", "", $_SERVER['HTTP_HOST']);
$input_user = new textfield(array('name' => '_user', 'id' => 'rcmloginuser', 'size' => 30, 'autocomplete' => 'off', 'onchange' => 'domainautocomplete(\'' . $domain . '\');'));

(Note: if your Roundcube installation is located somewhere like webmail.domain.com, then change “www” in the first line to “webmail”. Basically, that line just gets rid of the first part of the domain, so you’re left with “domain.com” )

Open program/include/rcmail_template.inc. On line 60, after

$this->include_script('app.js');

add the line

$this->include_script('domainautocomplete.js');

Finally, in the directory program/js/ create a new file titled domainautocomplete.js and add this content

function domainautocomplete(domain) {
    
    var loginField = document.getElementById('rcmloginuser');
    
    if( loginField.value != '' &&
        loginField.value.indexOf('@') == -1 ) {
        
        loginField.value = loginField.value + "@" + domain;
    }
}


iPhone Apper

MLB Mobile on the iPhone Home ScreenJon Maddox has created what I think is the best hack of the iPhone yet. Over at his website, you can enter in a website name, URL and icon, and it will download an application that you can then put on your iPhone which acts as a small bookmarklet on the phone’s home page. I couldn’t quite get the script to work with MLB Mobile, but I’ve created a working copy which you can download here. Enjoy!



MLB Mobile

Here’s the scenario: Monday night I’m sitting at the 49ers game, wondering what’s happening with the Giants. I pull out my iPhone and go to both the ESPN and MLB.com websites to keep tabs on the ball game. Both of these websites have mobile versions of their sites, but their geared to normal web-enabled cell phones, not the iPhone (and, as we all know, web design for the iPhone is completely revolutionary).

So, I decided to take it upon myself to built a better site. And now it exists as MLB Mobile, available at http://www.loganrockmore.com/MLBMobile/. And yes, it does that thing that a few people hate where the site is disabled on any browser that’s not the iPhone.

Vertical Game SummaryHorizontal Game Summary I had two main goals in mind when designing this new site. First of all, I wanted it to be fast, for use over the Edge network. So the entire site uses absolutely no images at all. All of the arrows and the diamonds used on the page are HTML Character Codes built into the browser. Secondly, and even more importantly, I wanted there to be two specially designed formats for each of the orientations of the phone. Thanks to some special javascript action, there is a whole handful of conditional CSS that displays differently when the iPhone is in landscape mode than when it is in portrait. This seemed much more logical to me than the usual iPhone action, which is to zoom the page in when viewing in landscape. I’ve tried to design the pages, especially the Game Summary page, to work as best as possible in both orientations. Check out the examples to see what I’m talking about and click for bigger versions. I also wanted the refresh button to be always available for updating, which is why I haven’t done the scroll to trick that all other sites are fond of.

Anyway, I hope that explains some of my thinking. Give the app a try and definitely let me know what you think. I do plan on adding a few more features at some point, and unlike desktop apps, I can do it at my leisure (thank god!).

We’ll see how it fares at Saturday’s Niners game…



Mail Unread Menu 2.5

Some great fixes in this release, especially focusing on Leopard and IMAP. Get it now. It’s free!

  • New Features
    • Added new icon, courtesy of Willem Hanhart.
    • Added the ability to alphabetize the mailboxes list.
    • Updated bundle to version 3 for Leopard compatibility.
    • The application now periodically updates to catch any missed changes.
  • Changes
    • Changed all URLs from burgundylogan.com to loganrockmore.com .
    • Changing preferences will now update the unread count asynchronously.
  • Fixes
    • Mailboxes in IMAP accounts can now be opened from the menu.
    • Fixed a crash when dealing with mailbox names containing asterisks.
    • Fixed a handful of memory leaks.

Update: Well, that broke fast. Turns out there was a problem with the asynchronous preferences window, so I’ve removed the feature. The preferences window may seem a little slow now, but hopefully it shouldn’t crash any more. Version 2.5.1 is available now. Sorry!



Website Backup Script

Tonight, I wrote a small python script (well, an SCP wrapper, actually) that will download the entire contents of my website for me. It’s a great one-command way for me to make sure I always have backups of what’s online. Just modify the settings at the top, throw this file into a directory that’s in your $PATH and make sure that it has executable permissions. In the command line, type backupwebsite and you’re good to go. Either Download or just peruse:

#!/usr/bin/python

loginname = "login"
domain = "mydomain.com"
serverpath = "/var/www/"
localpath = "~/Backups/"

from os import system
from datetime import datetime

# create directory name
directory = datetime.today().strftime('%Y-%m-%d-%H%M')

# get starting time
startingtime = datetime.today()

# perform scp
system('scp -r ' + loginname + '@' + domain + ':"' + serverpath + '" ' + localpath + directory)

# get ending time
endingtime = datetime.today()
print "\nbackup completed in ", endingtime - startingtime


Brand New Goodies

As you may have noticed, the whole website has moved over to the new domain loganrockmore.com. I made this change for a few reasons and I definitely think that it’s for the better. I have a new email address to go along with the change, too. You can now get a hold of me at dev@loganrockmore.com. For a while, all of the burgundylogan.com stuff will redirect here, just to make sure there is a smooth transition.

LR LogoI also added two completely new things to the site. First of all is a new logo that I designed, which I’m pretty happy with. Secondly, I’ve put up a Bug Tracker for all of the projects, to make it easier to file bugs and feature requests and to make it clear how I’m prioritizing my time and the status of certain tasks. Please feel free to make use of it and let me know what you think!




:: RSS Feed :: Archive :: Categories :: Admin