RSS 2.0 Feed
Posted on March 27th, 2010 at 11:24 AM by Corey Ballou

For starters, StackScripts™ provide a flexible way to customize Linode distribution templates.

While browsing through the public Linode Stack Scripts for RHEL distros I noticed there was no fully automated LAMP stack script so I took the liberty of creating one to mirror those provided in the Ubuntu section. Please note that I added a install_personal function. You can duplicate this script and add any packages you like to this function.

Click here to be taken to the RH Basics + LAMP Stack page

The majority of the credit should go to Linode user justintime for his StackScript Bash Library for RH Derivatives script which was a port from the Ubuntu section. I merely added a wrapper around his Stack Script and the base stack script.

Categories Linux
Tags , ,
Comments 1 comment
Posted on March 25th, 2010 at 03:41 PM by Corey Ballou

PHP inherently makes parsing an array of uploaded files more difficult than it needs to be due to the ordering of it’s array indices. Below is a quick example array:

$_FILES['fieldname']['name'][1] 		= 'uploadedfile.jpg';
$_FILES['fieldname']['name'][2] 		= 'uploadedfile2.jpg';
$_FILES['fieldname']['type'][1] 		= 'image/jpeg';
$_FILES['fieldname']['type'][2] 		= 'image/jpeg';
$_FILES['fieldname']['tmp_name'][1] 	= '/tmp/rAnDOmCHaRs';
$_FILES['fieldname']['tmp_name'][2] 	= '/tmp/RANdOmcHArs';
$_FILES['fieldname']['error'][1] 		= 0;
$_FILES['fieldname']['error'][2] 		= 0;
$_FILES['fieldname']['size'][1] 		= 1427;
$_FILES['fieldname']['size'][2] 		= 1576;

To combat this, we could create a function to reassemble the multi-dimensional array so that it is based on index rather than key. This allows for easier iteration of files. Here’s an example of the reindex $_FILES['fieldname'] array: more »

Categories PHP
Tags , ,
Comments no comments
Posted on March 4th, 2010 at 07:25 AM by Corey Ballou

Let’s face it, the default styling for many of the Facebook FBML tags is just not going to cut it. You’ll be happy to know that you can easily override these styles on your canvas pages by referencing an external CSS include. To begin, let’s create a template to place all of our content:

<link rel="stylesheet" type="text/css" media="screen" href="http://www.yoursite.com/css/canvas.css?v=1.2" />
<div id="container">
	<!-- AS AN EXAMPLE, WE'LL STYLE THE FB SHARE BUTTON -->
	<fb:share-button class="url" href="http://www.your-site-url.com" />
</div>

The versioning on the stylesheet is due to the fact Facebook caches your CSS. For every major change in your stylesheet you should increment the version. This simply lets Facebook know that you have some new content for them to load. Wrap your content in a DIV with an identifier as this will allow you to override Facebook’s default styling due to CSS selector inheritence.

The next step is crucial. more »

Categories APIs, CSS
Tags , ,
Comments no comments