WordPress and Network Solutions

Oh, Network Solutions, let me count the ways I despise thee. From your overpriced services, to your impossibly cluttered control panels, to your evil domain sniping practices

It’s a general rule for me that if I’m installing WordPress on a host I’m not familiar with, I will not use the automatic script but instead will opt to install manually.

Side Note: When at all possible, we try to use WebFaction for hosting – we’ve been using WebFaction here at Mad Lab for all our hosting for a few years now, and especially for our Django and WordPress projects, WebFaction has been nothing short of fantastic. If you’re looking for a host, give them a try. Their control panels aren’t exactly the most intuitive as they’re geared towards the more tech savvy customer, but their customer support is second to none. Final disclaimer: if you do sign up, please.use one of the links in this paragraph, and Mad Lab gets a tiny cut of what you spend. In closing, USE THIS LINK.

So back to it. Network Solutions forces WordPress into a subdirectory, which can wreak havoc with your .htaccess rewrites (I know it can be done, but why complicate matters?). So in order to put WP into your domain root, you have to do it manually. Not going to walk you through this… the part that’s a bit of a bear is the wp-config file. Normally, you’d put in ‘localhost’ as the DB server. In this case, Network Solutions needs the IP to the database server. So you need to go to your Network Solutions control panel, find the DB you created (manually of course), and find either the host alias or the IP to that DB server, and when creating your wp-config file, replace ‘localhost’ with that value.

Simple little fix, but knowing this will save you all sorts of time looking for the right way to connect the database to the WordPress installation.

Homer would be proud

In the never-ending quest to eliminate IE from our lives, sometimes we have to take the more pragmatic approach – since IE is so bad (especially in its earlier versions, which still persist), and since we can’t just ignore it, we fix it.

That’s right. We fix IE, since IE is too helpless to fix itself. Now I’m not a huge fan of browser hacks, but our analytics show that we still see between 40 and 60% IE users across our sites. That’s too significant to ignore.

Along comes CSS3Pie.

Homer Simpson dreams of pie.

CSS3Pie is a little javascript and browser behavior file that takes all the CSS3 behaviors that we are learning to know and love, and jams them down the throat of IE (well, technically, IE8 and earlier, since IE9 supports many of these properties), allowing a more consistent cross-browser user experience. That’s right – so all your rounded corners, linear gradients, box shadows, all at your fingertips to all browsers. It’s just a couple extra lines of code. So THANK YOU to the folks at CSS3PIE. Give us a hollar if you’re ever in town, we’ll take you out and buy you a slice – of the traditional kind, the kind Homer dreams of.

 

Giving Back To The Open Source Communtiy.

Many of us think just because we are aren’t writing the software we cannot contribute. Recently, I have started taking my first steps into helping out in my small way. I’m trying to do two things. The first is by writing posts here. Currently most of them are quite short, but hopefully people will find still find them useful. The second is by answering questions on Stack Overflow. I have found that service, and the users on it very helpful (even though I rarely ask a question directly).

So if you don’t think you can help, you’re wrong. Even as a user, by filing DETAILED (the key here is detailed!) bug reports when you find a problem in some open source software, you’re helping out big time.

(stepping off soapbox now)

When is an integer more than an integer in python?

Actually probably a lot of times .

In an application I was using the other day I was getting a strange failure. In my case one of my variables I was setting to one, and then after calling this other application, the value was suddenly False (not even an integer).  The offending application had the following code:


if x == True:
x = False

Unfortunately 1 evaluates to True in this situation. The code should have been:


if x is True:
x = False

Full screen Flash video on one monitor while browsing in the other.

Its nice to view flash videos fullscreen. Unfortunately, when you do something in the other monitor like click on a link in a browser the video shifts out of full screen.

Today, I noticed an strange anomaly. To keep the video in full screen mode while working in the other monitor do the following.

1. On the video right click and bring up the settings for flash. Then close the settings box.

Now when you go to the other monitor, and click on the browser the video STAYS FULL SCREEN.  This is just what I wanted.

Will this work for you? I don’t know. This may actually be kind of a “bug” with my current software setup .   So FYI my configuration

Ubuntu 11.10

Chrome  17.0.928.0 dev

Flash 11,0,1,152

The site was ESPN360 (needs to be tested with other sites).

Easy Bitbucket push and pulls with ssh on webfaction.

Normally when doing a push or pull from Bitbucket one needs to enter a password every time one does a push or pull.  To avoid this one can switch from  https access to ssh.

MODIFY THE MERCURIAL SETTINGS:

Change to the .hg directory for the project. Edit the hgrc file and change  the path to

default = ssh://hg@bitbucket.org/username/repositoryname/

It is is critical that the username here is “hg”

CREATE YOUR SSH KEYS:

This I had to do in few steps. You maybe able to do yours in one step.  The following commands did the trick for me.

ssh-keygen
chmod 644 ~/.ssh/id_rsa.pub
ssh-agent bash
ssh-add

The ~/.ssh/id_rsa.pub is your public key

Now we need to add the public key to BitBucket

  1. Log in to Bitbucket.
  2. Click the ‘Account‘ tab
  3. Under the ‘SSH keys‘ pane, do one of the following:
    • Copy and paste the text from your public key file (~/.ssh/id_rsa.pub) into the text input box and click the ‘Add key’ button, or
    • Click the ‘Choose File‘ button, browse to your public key, then click the ‘Upload key‘ button
Your all set now to use ssh for your push and pulls to BitBucket.  The big advantage to this is it simplifies using Fabric for deploying your application to Webfaction.
My next post will detail a very simple fabric file for automating the site update process by using Fabric.

jQuery Slideout Tab

Looking for a place to anchor some content – easily accessible, but non-intrusive? I was recently looking for a way to make the “Reservations” tab for the restaurant site Rialto Cafe a little less in-your-face, but still easily accessible from anywhere on the site. Putting it in the header just seemed too cluttered, and the footer pushed it too far down the page.

Enter the ‘slideout tab’ – It’s nothing new, you’ve probably seen it before, mostly used as a “feedback” tab. But in this case, I used a little jQuery plugin called tabSlideOut. The jQuery has several parameters you can set, including size, speed of animation, and position on the screen. In this case, I was using WordPress and just pulled in a form using the WP get_template_part(); function. But you could just as easily code in your html, or use ajax to load in something dynamically.

What you end up with is a nifty little “drawer” style tab that you can slide out from a fixed or floating position on either side of the screen – and it’s cross-browser compatible.