29
Aug 11

Email the Forgotten King

The trend these days is to have a facebook page or a twitter account that people can like or follow you, which by any reasonable measure is a good thing, or so it seems on the surface.

But it had me thinking about a few questions…

Who really owns your  fans, followers, or potential customers?

What if the network is down/offline or is shutdown permanently, could you still contact them?

What if the network kicks you off,  blocks you or decides they are taking over your page/account is there much you could do to stop them?

Believe it or not the social networks are in control of your fans, followers, and potential customers.

Don’t believe me?  Try to export your fans or followers so you can contact them directly…didn’t find the export button did you? Do you even know how to contact them directly or who they really are?

The truth is the ease of social media allows us to tweet or post effortlessly which has lead to us forgetting about how we used to communicate in the past.

Email was once and still is the King.  It is the only way you can truly own and communicate directly with your fans, followers, and potential customers.

The solution is therefore simple, no matter what social network you are using, always try (with their permission) to get your fans, followers, and potential customers contact details.

Information like:

  • Correct full name (recommended),
  • Email address (minimum),
  • Telephone (preferably mobile so you have an option to send a text instead)
  • Location, gender and age (perhaps range) are useful information to keep as well.

You do have your fan’s/follower’s/potential customer’s email address right or does facebook/twitter have that too?


24
Apr 11

Automatically starting XAMPP on MAC OSX boot up

Using Terminal

$ cd /Library/StartupItems

$ sudo mkdir xampp

$ cd xampp/

$ sudo nano xampp

Enter the contents below:



#!/bin/sh

/Applications/XAMPP/xamppfiles/xampp start


If you installed XAMPP elsewhere you will need to modify the path above.

You can also start specific xampp apps for example, starting apache only by using /Applications/XAMPP/xamppfiles/xampp startapache instead.

 

$ sudo nano  StartupParameters.plist

Enter the contents below:



<?xml version=”1.0″ encoding=”UTF-8″?>

<!DOCTYPE plist SYSTEM “file://localhost/System/Library/DTDs/PropertyList.dtd”>

<plist version=”0.9″>

<dict>

<key>Description</key>

<string>XAMPP</string>

<key>OrderPreference</key>

<string>Late</string>

<key>Provides</key>

<array>

<string>Starts Apache and MySQL</string>

</array>

<key>Uses</key>

<array>

<string>SystemLog</string>

</array>

</dict>

</plist>


$ cd ..

$ sudo chown -R root xampp

$ sudo chgrp -R wheel xampp

$ sudo chmod 755 xampp/xampp

 

That’s it!

All you now have to do is to restart your MAC and xampp will start automatically on boot.

 

Original Solution was by Sreeprakash N which can be found here (http://sree.cc/mac-os-x/how-start-xampp-at-startup-on-mac-os-x) , however it’s not easy to follow as a few commands have been jumbled together, hence this post to make it easier for others to follow.

 


11
Mar 11

Digicel Buys Out Claro Jamaica – What does it mean?

In an unexcpected move, that has caught everyone off guard and by MEGA surprise, Digicel acquires Claro Jamaica.

What could this buyout/merger mean, as it stands now it raises more questions than answers for ICT industry.  What do we stand to gain or loose.

 

Will iPhone become available to the masses, is this the beginning of the end of Blackberry Country?

Will iPad 1 and iPad 2 become the new laptop?

Will Edge be upgraded to the 3G, and will Digicel expand the 3G network or move it to LTE (Mobile 4G)?

 

 

What do you think is going to happen after this merger is completed?

 


03
Dec 10

QuickNote: Deploying Required Zend Framework Components Only

Read an interesting way to detect and determine what zend framework components your application uses.

Feels brute force, but it gets the job done.

Article:

Deploy the bare minimum required Zend Framework scripts in your application library

Link:

http://ingol.nl/blog/2010/12/02/deploy-the-bare-minimum-required-zend-framework-scripts-in-your-application-library/


13
Sep 10

Software Patents a RISK to the Jamaican and Caribbean ICT industry

(Reposted from SiliconCaribe) If you haven’t been paying attention billionaire Paul Allen (co-founder of Microsoft) is suing Apple, Google, Facebook, AOL, eBay, Netflix, Yahoo!, Staples, OfficeMax, Office Depot, and YouTube over patent infringements. “A patent is a set of exclusive rights granted by a state (national government) to an inventor or their assignee for a limited period of time in exchange for a public disclosure of an invention.”, Wikipedia.

It is perhaps one of the biggest patent lawsuits to date, and it is one of many patent lawsuits filed since the start of the year. Paul Allen company Interval Licensing has hundreds of patents and has chosen four (4) out of its arsenal to use in the suit. One of the patents mentioned in the suit is the analyzing of a user’s behaviour/action (e.g. search) to suggest a list of related content. Doesn’t this sound like a lot of websites you use? Continue reading →


15
Apr 10

Cut Your Zend Framework Application Upload Time by a Gazillion

Uploading applications built with Zend Framework (or any other Feature Rich Framework) via FTP/SFTP is just boring and takes too long. Not to mention the size of your own application and additional third party files that you may need to upload to your server.

One solution is to roll your own package that only includes the necessary components, another is to zip, upload and unzip.

For the time being I decided to choose the latter.

With just a quick review of the zip extension on php.net/zip, I found in the documentation a possible solution.

I added my two cents and ended up with this



<?php

$file = basename($_GET['file']);

$extractTo = realpath(dirname(__FILE__)) . '/' . time() . '/' ;

echo "Extracting $file to $extractTo";

$zip = new ZipArchive;

if ($zip->open($file) === TRUE) {
    $zip->extractTo($extractTo);
    $zip->close();
    echo ' - done';
} else {
    echo ' - failed';
}
?>


You then do a simple http://www.example.com/unpack.php?file=myapp.zip and your files are extracted in no time.

As you can see nothing fancy.

It creates a new folder within the same location you placed the script . The folder is named after the current timestamp to avoid overwrites.

As per usual, do the necessaries to protect this script.

How do you cut your upload time?


22
Mar 10

Prevent Access to LAN

In writing an app that communicates notifications via HTTP requests, to a user specified URL, it brought up an interesting security question. How do you block them from requesting a URL that accesses the LAN ?.

The function below was created to do just that.



function isOnLAN($url)
{

$urlParts = parse_url($url);

$domainName = $urlParts[‘host’];

$ip = gethostbyname($domainName);

if (ip_in_network($ip,"172.16.0.0", 12))
return true;

if (ip_in_network($ip,"192.168.0.0", 16))
return true;

if (ip_in_network($ip,"10.0.0.0", 8))
return true; //true

return false;

}

// Taken from php.net - http://jm2.php.net/manual/en/function.ip2long.php#92544
function ip_in_network($ip, $net_addr, $net_mask){
if($net_mask <= 0){ return false; }
$ip_binary_string = sprintf("%032b",ip2long($ip));
$net_binary_string = sprintf("%032b",ip2long($net_addr));
return (substr_compare($ip_binary_string,$net_binary_string,0,$net_mask) === 0);
}


Usage:



if (isOnLAN("http://192.168.1.1"))
  echo "Address on LAN";
else
  echo "Address on INTERNET";



27
Jan 09

Translated Time Zone Listing for Zend_Form

Timezones available:

  • timezonetowindows
  • windowstotimezone
  • territorytotimezone
  • timezonetoterritory
  • citytotimezone
  • timezonetocity


$form = new Zend_Form();

$timeZoneList = $locale->getTranslationList("timezonetoterritory");

$timeZone = $form->createElement('select', 'time_zone', array(

'filters'    => array('StringTrim'),
'label'      => 'Time Zone:',
))->addMultiOptions($timeZoneList);

$this->addElement($timeZone);



21
Jan 09

Theme your Zend Framework Application

Allowing users to customize the look of your application is always welcomed. Here is one approach using Zend Framework.

First lets look at the directory structure for creating a themeable application.

Typical Layout:
root

— private

— public

—— css

—— js

—— images

You’ll notice that all our publicly available files for stylesheets, javascript and images are placed in the public folder. We are going to alter this by placing them into a sub-folder under public called ‘default’.

Our structure now looks like this.

root

— private

— public

—— default

——— css

——— js

——— images

What this allows us to do is encapsulate all our files/assets into a single folder that we can now easily reference. All our themes and their assets should now follow the same naming convention as our ‘default’ folder.

Adding a theme to our structure now looks like this
root

— private

— public

—— default

——— css

——— js

——— images

—— modern

——— css

——— js

——— images

In our application bootstrap we add the following line of code (around where you initialize the session)



$session = Zend_Registry::get('Zend_Session'); //change this to match how you store your sessions

if (!isset($session->theme))

$session->theme = 'default';


To easily use this in our application lets create a view helper.



class My_View_Helper_Theme
{
/**
* Returns site base url based on the current theme
*
*
* @return string
*/
public function theme($content = '', $prependBase = true)
{

if ($prependBase)
{
$baseUrl =  Zend_Controller_Front::getInstance()->getRequest()->getBaseUrl();
}
else
{
$baseUrl = '';
}

$session = Zend_Registry::get('Zend_Session'); //change this to match how you store your sessions

$url = $baseUrl . $session->theme . $content;
}
}

In our view we can now use our view helper to fetch the correct file from the current theme.



<img src="<?php echo $this->theme('/images/blankslate.jpg') ?>" />


We can make our view helper a little more helpful by adding a fallback to the default if the file doesn’t exist in the theme.



class My_View_Helper_Theme
{
/**
* Returns site base url based on the current theme
*
*
* @return string
*/
public function theme($content = '', $prependBase = true)
{

if ($prependBase)
{
$baseUrl =  Zend_Controller_Front::getInstance()->getRequest()->getBaseUrl();
}
else
{
$baseUrl = '';
}

$session = Zend_Registry::get('Zend_Session'); //change this to match how you store your sessions

$url =  '/public/' . $session->theme . $content;

$location = DOCUMENT_ROOT . $url;

if (file_exists($location))
{
return $baseUrl . $url;
}
else
{

// If theme doesn't exist then use the default theme

$url = '/public/default' . $content;

return $baseUrl . $url;
}
}