Dual-boot Windows 7 and Ubuntu, with Virtualization!
0So, you want to dual boot Windows 7 and Ubuntu, that’s the easy part. Just install Ubuntu and follow the instructions for setting up dual boot. The more difficult part is getting VirtualBox to use your physical partition.
Help! My wordpress dashboard is blank!
0I had this after installing a new theme. All you have to do is find your php.ini file on your server, and change the line memory_limit = 32M to memory_limit = 128M
Gosh darn it, it works!
Updated android apps
0I’ve now updated my android apps to not have any ads. If you want to support the development efforts, then buy the paid for version, if you don’t, you can still download the free version and use it without ads or nag screens.
Technology problem checklist
0Gavin’s [technology name] Checklist.
1. Is your [technology name] on? If yes, go to 3.
2. Switch your [technology name] on.
3. Is it working? If yes, go to 5.
4. Turn it off. Then go to item 2.
5. Don’t fiddle with it. Enjoy your working [technology name].
Warning: Infinite loops may occur using this checklist.
Some great reasons to start a blog for your small/medium business
0You run a small business, you have a website, you advertise, you do all the usual things you should to promote your business, you can take that to the next level with a blog.
Ideally you should have a blog as part of your website, off a URL on your site such as http://www.example.com/blog/ or as a subdomain such as http://blog.example.com/ you can easily set up blogs on sites such as wordpress.com and blogger.com to use your domain, so you don’t even have to host it on your web server.
Simple image thumbnail creator in PHP
1This is a very simple function, but very useful for resizing JPEG images on the fly. You need to make sure GD is enabled on your PHP installation. It will resize any JPEG picture to a specified width, very handy for eCommerce sites. It will actually fit any picture into a square thumbnail of $size by $size.
usage: processImage($file,$dest,$size)
$file – the name of the file, use full directory name
$dest – the name of the file to output
$size – WIDTH of the file.
function processImage($file,$dest,$size)
{
$src = imagecreatefromjpeg($file);
/* create thumbnail */
$thumb = imagecreatetruecolor($size,$size);
$red = 255; $green = 255; $blue = 255;
$color = imagecolorallocate( $thumb, $red, $green, $blue );
/* fill with white */
$x = 1;
$y = 1;
imagefill($thumb, $x, $y, $color);
/* get image original width and height */
$src_x = imagesx($src);
$src_y = imagesy($src);
/* scale to fit width of $size if image is wider than height, align vertical center */
if($src_x>$src_y)
{
$ratio=$size/$src_x;
$new_x=$size ;
$new_y=$src_y * $ratio;
$new_xpos=0;
$new_ypos=($size - $new_y) / 2;
}
else /* scale to fit height of $size if image is higher than wide, align vertical center */
{
$ratio=$size/$src_y;
$new_x=$src_x * $ratio ;
$new_y=$size;
$new_ypos=0;
$new_xpos=($size - $new_x) / 2;
}
/* copy to new image and save */
imagecopyresampled($thumb,$src,$new_xpos,$new_ypos,0,0,$new_x,$new_y,$src_x,$src_y);
imagejpeg($thumb,$dest,80);
}
Make debugging MySQL simple with a PHP database wrapper
3I built this simple MySQL wrapper a while back to simplify debugging MySQL code. It’s easier to write and use a wrapper that to have a load of print debugging statements. I’ve built one for both the mysql and mysqli interfaces in PHP.
PHP Wrapper for MySQL interface
PHP Wrapper for MySQLi interface
Pull XML into a table with filtering in jQuery
1
Now we’re getting into more complex territory, this small project pulls in data from an XML file and feeds it into a table in your page, this XML can be either a server side script, or a feed, or just a static XML file. You wouldn’t want to do this on your main site as search engine’s wouldn’t be able to spider the table, but it’s really useful for dashboards, statistics, admin pages, etc. You can filter the XML without reloading either the XML or the page.
Example demo XML table with filtering
Download Files (5Kb)
CSS Menus with jQuery Effects
1
This is a continuation of the previous post Pure CSS Dropdown Menus. jQuery is used only for creating neat effects when menus are rolled over.
Example CSS Menus with jQuery Effects
Download Files (4Kb)
There are some caveats, this code will most likely not work in IE6. It will however work in most modern browsers including IE7. The best idea is to download the code and see how it works.
(more…)
Pure CSS drop down menus
1
Drop down menus are great if you need a more tree like structure in your menus. This version is for a 2 level navigation style menu bar with drop down lists. They can be any size, just adjust the CSS accordingly.
Example Pure CSS Drop Down Menus
Download Files (4Kb)
There are some caveats, this code will not work in IE6. Internet Explorer 6 does not support :hover on elements other an anchor (A) tags. It will however work in most modern browsers including IE7. The best idea is to download the code and see how it works.
(more…)
