Archive for January, 2008

Movable Type QuickPost

Friday, January 18th, 2008 at 10:15 pm

I still haven’t finished putting the site back together after upgrading Movable Type, but I really like the new version. The admin interface is a lot cleaner and easier to use, and everything feels…sturdier, I guess.

I’m not sure if QuickPost was a feature in 3.2, but I didn’t know about it if it was. And really, calling it a “feature” is an overstatement. It’s just a bookmarklet that you drop in the bookmarks toolbar of your browser, and it allows you to quickly start a post about the web page you’re looking at. For those of you who ARE using Movable Type (and this post won’t be of much interest to anyone else), there’s a QuickPost link in the Write Entry page, down below the Save and Cancel buttons.

It’s a handy little bookmarklet, but by default, it doesn’t work the way I would like. It pops up a new window with a new blog post that contains the URL of the page you were looking at, two <br>’s, and then any text you had selected on the page.

That’s a good start, but clunkier than I would like, so I changed mine a fair bit. Here’s what I’m using - it’s one long line that won’t fit in your browser, so copying it might be a pain.

javascript:d=document;w=window;t='';if(d.selection)t=d.selection.createRange().text;else{if(d.getSelection)t=d.getSelection();else{if(w.getSelection)t=w.getSelection()}}entryTitle=encodeURIComponent(d.title);if(t=='')entryBody='';else entryBody=encodeURIComponent('<blockquote>') + encodeURIComponent(t) + encodeURIComponent('</blockquote>\n\n');entryBody+=encodeURIComponent('<a href="') + encodeURIComponent(d.location.href) + encodeURIComponent('">Link</a>');url='http://site.com/cgi-bin/mt.cgi?__mode=view&qp=1&_type=entry&blog_id=1&title=' + entryTitle + '&text=' + entryBody;void(w.open(url))

And here’s a more verbose version, so it’s easier to see what’s going on:

d = document;
w = window;
t = '';
if(d.selection) {
t = d.selection.createRange().text;
}
else {
if(d.getSelection) {
t = d.getSelection();
}
else {
if(w.getSelection) {
t = w.getSelection();
}
}
}
entryTitle = encodeURIComponent(d.title);
if(t == '') {
entryBody = '';
}
else {
entryBody = encodeURIComponent('<blockquote>') + encodeURIComponent(t) + encodeURIComponent('</blockquote>\n\n');
}
entryBody += encodeURIComponent('<a href="') + encodeURIComponent(d.location.href) + encodeURIComponent('">Link</a>');
url = 'http://site.com/cgi-bin/mt.cgi?__mode=view&qp=1&_type=entry&blog_id=1&title=';
url += entryTitle + '&text=' + entryBody;
void(w.open(url));

I changed a few things. For one, “_blank” is no longer included in the window open. Under my Firefox configuration, this means that it comes up in a new tab instead of a new window. I also changed the entry body; now, it turns the URL of the page into a link (with the text “Link”), and any selected text goes above that in a <blockquote>. Basically, you get a new post that’s in the format Boing Boing typically uses.

If you want to try it out, do the following:

  1. Drag the QuickPost link from the Write Entry screen into your bookmarks toolbar.
  2. Open your favorite text editor - Notepad will do - and copy that first block of code above into it.
  3. Right-click on the bookmark and select Properties. Copy the Location field into your text editor too.
  4. You need to pull the URL out of your QuickPost code and put it into mine. Obviously, the domain part won’t be site.com, and the blog_id might be different if you’re running more than one blog in your MT installation.
  5. Copy the new code with the correct URL into the Location field for the bookmarklet. Make sure there aren’t any line breaks in it.
  6. That’s it. Test it out by going to any web page, select some text, and click the QuickPost bookmark. You should get a new post that contains the text you had selected.

Drop me a note if you’ve got any questions or suggestions for improvements, or just post a comment here.

Neck Deep

Thursday, January 17th, 2008 at 10:43 am

Have you ever had one of those mornings where you’re thirsty, hungry, and you have to pee, but you’re too busy working on something and don’t want to lose track of what you’re doing so you don’t get up to deal with that kind of stuff?

That’s how my morning has been so far. Sometimes, it’s really satisfying, because you keep doing that “just five more minutes, bladder” thing, and then - hurrah! - you finish whatever it is you’re working on, hit the head, and grab another Coke. Other times, you find a bug, and know that it won’t be finished before your bladder explodes.

Sure is nice to stop and take a leak though, isn’t it?

Accused Murderer Says God Made Him Kill [Atheist Revolution]

Wednesday, January 16th, 2008 at 8:54 am

From Atheist Revolution:

Whenever someone commits a horrible crime and then claims that some god told them to do it, believers and non-believers unite to reject the claim. Non-believers have an easy time rejecting the “god make me do it” defense because we reason that mythical beings cannot influence human behavior. We might accept the possibility that the criminal’s belief contributed to the action, or we might look for mental illness. The believer often has a different path to the same conclusion. For the believer, god did not command them to engage in the despicable act because god would never do such a terrible thing. Of course, one only has to read the Christian bible or listen to Pat Robertson to realize that this is simply not true.

Link

Upgrading Movable Type

Sunday, January 13th, 2008 at 9:59 am

I’m in the process of upgrading Movable Type, so things may be a little wonky for the next couple days. It was time for some spring cleaning, so I did a fresh install. I think MT is all set, and all my old posts are here, but I’ve still got some more content to move over from the old site - stuff like my Projects and Portfolio pages, the About Me page, that kind of stuff.

That, and in MT4, entry URLs use dashes for spaces instead of underscores. I have links to my own posts in the format “whats_so_great_about_christianity.php”, but if you actually go to that post, the URL is “whats-so-great-about-christianity.php”. I’m assuming that’s a setting I just haven’t found yet, but until I do, links within new posts to old posts will be broken.

If you find any gaping holes, please drop me a note.

On NOT Getting Things Done

Friday, January 11th, 2008 at 9:24 pm

I finally got around to reading Getting Things Done. I first tried to implement it during that month or two we were incredibly busy at work, so it didn’t really take - at least partly because I never did a full mind-dump to get everything in the system to begin with.

A couple weeks ago, I started playing with OmniFocus, and decided to give GTD another go. Since then, I’ve gotten pretty good about putting stuff in.

The problem is getting stuff out. I still haven’t gotten into the habit of checking OmniFocus when I’ve got free time to see what I should be doing. I feel like everything in OmniFocus is still in my head - I have some free time and think, “I don’t feel like doing any of that stuff,” because I know what stuff is in there. I need to get in the habit of checking it on a regular basis, so I can just put all my to-do’s into it and forget about them.

If anyone has any advice or suggestions on forming that habit, let me know.

Converting Videos for TakeTV with VisualHub

Friday, January 11th, 2008 at 9:05 pm

This year, I got me a Sansa TakeTV for Christmas. The system requirements make no mention of OS X, so I did some looking around online before opening it up - I only have a Mac, you see, and I wanted to make sure I could use the damn thing.

The Internet says I can use the damn thing, and I can. Unfortunately, it doesn’t handle many formats, so I’ve been trying to figure out how to convert video files and DVDs to DivX without having to pay for any software, or put much effort into it.

I’ve already got VisualHub, so I was hoping I could use that. I couldn’t find any specifics online for VisualHub and TakeTV, so I spent a little time fiddling with it. It took me a few tries, but I figured out how to do it.

  1. Select the AVI tab
  2. Drag your video file(s) into the big box in the middle
  3. Click on the Advanced button - you have to change one of those fields that they tell you not to change
  4. The last field in the Video section is “Extra ffmpeg flags.” In that dropdown, select “Best Possible MPEG-4″ (even though you’re making an AVI). This should be replaced with the following ffmpeg flags:
  5. -vcodec xvid -mbd 2 -me full -flags +4mv+trell -aic 2 -cmp 2 -subcmp 2

  6. Close that window
  7. Pick a destination directory in the “Save To” box
  8. Click the Start button
  9. Give it about half an hour, and you’ll have a video file to drop on your TakeTV flash drive

I hope that makes life easier for someone, because I spent a while looking around with no luck at all.