Archive for the ‘Everyday Tips’ Category

Setup Subversion with cPanel and Apache

Posted on January 21st, 2010 in Everyday Tips, PHP, Sys Admin | 1 Comment »

This is a  summary of how to set up a new svn repository that you can access through apache when your server is configured with cPanel. This is not a tutorial on installing cPanel and Subversion.  The assumption is that you already have subversion installed on your cPanel managed server.

Read the rest of this entry »

Stay Away From Rackspace Cloudsites

Posted on December 31st, 2009 in Everyday Tips, PHP | 10 Comments »

I have worked with several dedicated servers at Rackspace and the experience was a joy. The servers perform very well and the Rackspace managed support was great. So when I learned of Cloudsites which appeared to bundle the great support I had grown to love with a package that seemed great for hosting our sites that didn’t require their own dedicated server I was very excited. Unfortunately, it turns out the Rackspace Cloudsites is unstable, unreliable, and slow. The support is still good, at least in terms of being available, but all they can say is “I’m sorry all your sites are down.”

Read the rest of this entry »

Top Ten WordPress Plugins

Posted on December 5th, 2009 in Everyday Tips, PHP, Web Development | 1 Comment »

We’ve been asked what WordPress plugins we use most often and what we recommend that other people use on their sites. There are quite a few great plugins out there, but here is our top 10 list of WordPress plugins that we have found the most useful and that we use the most often.

Read the rest of this entry »

My Noise Canceling Headphones

Posted on September 23rd, 2009 in Everyday Tips | No Comments »

It seems like a simple idea and often times simple ideas are the best ones. Build a set of noise canceling headphones that physically reflect noise away from your ears.

Read the rest of this entry »

Great Use For Javascript Closures

Posted on June 24th, 2009 in Everyday Tips, PHP, Web Development | No Comments »

setTimeout() with a paramter

If you need to use the setTimeout() function to call a javascript function that accepts a parameter you might be tempted to use syntax like

setTimeout('functionName()', 1500, param1, param2, etc); 

And you would probably have success until you went to test your site in Internet Explorer. Firefox seems to be able to handle the extra parameters on the end of the setTimeout() call but IE simply sends undefined variables to the function you are calling and your script dies.

Here is the solution – use closures! They are a little tricky to understand if you are new to the idea but, in a nutshell, you are assign a function to a variable. Normally you assign numbers, or strings to variables – well you can assign functions to variables too. Here’s how:

setTimeout(function() { delayedFunctionName(param1); }, 1500); 

This causes the function delayedFunctionName(p1) to be called with a 1.5 second delay AND the p1 parameter actually gets a value!

Then != Than

Posted on April 22nd, 2009 in Everyday Tips | 1 Comment »

I can’t believe how many people seem to not know the difference between then and than. They are not the same word at all. For some reason people tend to forget about “than” altogether and only use “then” and it is extremely annoying. So FOR THE LOVE OF ALL THINGS DECENT please learn the difference between then and than. Then means next and than means instead of. Here are a few examples.

Proper Use of THEN

First I will shower, THEN I will get dressed.

I saw him fall THEN he cried like a baby.

Open up the system folder THEN click the remote login check box.

Proper Use of THAN

I’d rather eat grapes THAN grass.

Men are generally taller THAN women are.

Fried food is less healthy THAN raw vegetables.

Share Files Between Linux and Mac

Posted on April 21st, 2009 in Everyday Tips, Mac OSX, Ubuntu | No Comments »

It is EXTREMELY easy to happily share files between your linux system and your mac. I use both Ubuntu and Mac OS X. Simply login into you mac desktop, open up your system settings and turn on Remote Login. This enables incoming SSH connections to your mac. If you want to connect while you are away from home, you can set up some sort of dynamic IP service like DynDNS.org. Open up port 22 on your home firewall or router and you can connect to your home mac from anywhere you go with an internet connection.

Once your mac has SSH enabled, log into your Ubuntu machine and click Places –> Connect To Server. Choose SSH as your Service Type. Enter in the IP address of your mac or whatever name you may have assigned to it in your /etc/hosts file or whatever. Use the username and password you use to log into mac and there you go. You can browse files on your mac with your Ubuntu machine in Nautilus.

Vim: How To Fold Functions

Posted on March 20th, 2009 in Everyday Tips, PHP, Vim, Web Development | No Comments »

Vi Gang Sign

The is really a tip on how to fold any code block including functions. Navigate your cursor somewhere inside of the code block you want to fold, make sure you are in command/normal mode (press escape if you need to) then type zfa}

To save your folds between vim sessions you need to issue the command :mkview otherwise when you close vim your folds will be lost (your folds, not your code). To make life easier on you, you can have your folds automatically saved for you by adding this to your .vimrc file

au BufWinLeave * mkview
au BufWinEnter * silent loadview

Recursive searching in vim with grep – vimgrep

Posted on February 17th, 2009 in Everyday Tips, PHP, Ubuntu, Vim, Web Development | 1 Comment »

Vi Gang Sign

One of the smartest people I’ve ever digitally met, Ryan Paul, taught me this awesome tip for doing a project wide search in vim. I needed to look for all occurrences of the patter _Models_ in a PHP project I was working on and you can do it right inside of vim – the best text editor ever invented.

  1. Open vim and make sure you are in the top level folder of your project by typing :pwd
  2. Then type :vimgrep YourPattern **/*.php
  3. To open your search results in their own buffer type :copen

The **/ recursively searches through all your directories for you pattern. :copen opens the search results in their own buffer. You can use the arrow keys to move up and down through the list and hit enter to have it open that result in the main buffer. You can also use :cnext and :cprev to move to the next and previous items in the list. Perhaps you might bind those to keyboard shortcuts so you can move through the search results quickly.

How To Delete URL Auto-fill In Safari – One At A Time

Posted on December 12th, 2008 in Everyday Tips, Mac OSX, Web Development | 2 Comments »

I like using Safari and I’m a web developer. Sometimes I’ll be developing a website and then decide to rename a page. The problem is Safari will cache the old pages’ URL and then auto-fill the old URL as I’m typing. Then I hit enter and shucks, I’m getting a File Not Found error. In FireFox you can just press Shift-Delete to get rid of the outdated URL. In Safari, to delete one, several, or even all of your cached urls used by the auto-fill feature, just delete the offending URLs from your history.

To do this you can go to Bookmarks –> Show All Bookmarks. Then in the upper right corner of your window you can search for the URL you want to delete. I’m frequently typing the domain of our development server so I can delete all of the development URLs they may be outdated. Once you see the URLs you want to delete, highlight them and press Delete. This is a little more cumbersome than Firefox’s Shift-Delete but at least it can be done.

Note: Both History and Bookmarks are used for the auto-fill feature. So even if you delete all of your history, the URLs from your Bookmarks will still be used for auto-fill. Of course, if you have bookmarked a page that is no longer available you probably want to delete that too.

Get Adobe Flash playerPlugin by wpburn.com wordpress themes