Scripting

Ramblings and links to interesting snippets


Alignment issues

Tags: , , , , ,

Ever have this problem where your centered elements will “wiggle” out of place when you adjust the size of your browser?  It’s just by one pixel, and annoys me to death.

I found this article about it: http://acko.net/blog/css-sub-pixel-background-misalignments

It seems like it’s a margin/padding issue.  I took the offending div element and added “margin-left: 1px;” to it’s class and it worked!  Beautifully :)  You may also need to nudge any background images by one pixel.

It does concern me that other elements on the page align perfectly, where it was only the #footer div that was giving me grief.

UPDATE

The aformentioned fix applies to 100% divs that have a centered background.  I came across this same problem in a div that was set to margin:auto;.  I went ahead and added “margin-left: 1px;” to the body and that fixed everything up nicely :)

Permalink » No comments

ApacheBench

Tags: , , , , ,

I was looking around today for some means to load test my scripts, I happened upon this website:  http://loadimpact.com/

It’s free services were alright, but up to 50 users just won’t put my scripts through they’re paces!  I’ve looked into trying something called ApacheBench before, but had trouble.  It’s something you can only access through SSH, and when in there I kept receiving “-bash: ab: command not found” errors.  Not fun!

The problem was I wasn’t in the right directory.  I found out you can search for ApacheBench but running “find / -name ab” (without quotes)  then you would include the directory when running ApacheBench “/dir/ab -n 100 http://yourdomain.com"

References:
http://sharebear.co.uk/blog/2009/03/12/optimising-django-dreamhost/
http://www.webmaster-talk.com/php-forum/116797-web-stress-tools-recommend.html
http://httpd.apache.org/docs/1.3/programs/ab.html
http://wiki.dreamhost.com/Ssh

Permalink » No comments