Archive for August, 2007

Vim Uppercase & Lowercase

Posted on August 29th, 2007 in Everyday Tips, Ubuntu, Vim | 7 Comments »

I have been using vim for a couple years and every week it seems I learn some new feature or trick you can do. Recently I learned how to convert a selection to either all uppercase or all lowercase letters.

Convert a visual selection to all uppercase letters.

gU

Convert to lowercase letters

gu

PHP vs Ruby – Practical Language Differences

Posted on August 20th, 2007 in PHP, Ruby on Rails | 13 Comments »

I have been developing PHP applications professionally for over 7 years. About a year ago, I decided to try developing some Ruby on Rails applications. My main Ruby on Rails projects have included an e-commerce site QuietHeadphones.com and an online application for synchronizing medical records with USB thumb drives. Of course, I have also worked with the Ruby on Rails blogging engine Mephisto which is what runs this website. So while I have worked with PHP for more time than I have worked with Ruby on Rails, I have worked with Ruby on Rails long enough to have noticed some significant differences between the two languages. My comparison is going to focus on the language differences between PHP and Ruby and not as much on the Rails framework.

Read the rest of this entry »

ImageMagick + Gimp + PNG Offset Trouble

Posted on August 5th, 2007 in Uncategorized | 4 Comments »

I have a custom little utility that I wrote that uses ImageMagick and Zenity to take a screen shot. I have the script hooked up to Z keyboard command. This is the bash script.

#!/bin/bash

fn=$(zenity --entry --title='File Name' --text='File Name Prefix');
dt=`date '+%Y%m%d'`;
screenshot="/home/USERNAME/Desktop/$fn-$dt.png";
import -frame +repage $screenshot;

Be sure to change USERNAME to your actual username so the path to your desktop will be correct. Also, for the sake of your sanity, please note the +repage switch that we pass to ImageMagick’s import command. Without that, Gimp will be very unhappy with the offset of the PNG. The layer will appear outside of the image and you won’t be able to see your screen shot in Gimp. If you happen to have that problem already, you can zoom out in Gimp, then use the move tool to drag your image back into view.

The screen shot utility, when invoked, will first prompt you for a little file name prefix using zenity. That prefix will have a date appended to the end of the saved file name. So, for example, if you ran this script today and typed in “receipt” as the file name prefix, the final saved image will be named “receipt-20070804.png” since today is August 4th, 2007. After typing in your file name prefix, you will see a + style cursor. Either click on a window or click and drag a selection on your screen to take the screen shot. The sreen shot will be saved to your desktop.

How To Get Your Scanner Working In Ubuntu Feisty

Posted on August 1st, 2007 in Everyday Tips, Ubuntu | No Comments »

My scanner (Canoscan N676U) suddenly stopped responding when I upgraded to Ubuntu Feisty. I first noticed the problem when I was unable to import a scan through Gimp. Well it took a couple hours to figure this one out, but the sollution turned out to be easy to implement. From what I understand, the problem comes from the USB suspend functions built into the new kernel. I also understand that this isn’t just an Ubuntu problem. So if you are on another distro, this tip may work for you also.

Read the rest of this entry »

Get Adobe Flash playerPlugin by wpburn.com wordpress themes