onin's picture

Agile Software Development Methodology

Sprint Planning

  • Lock Requirements During Sprint
    • Changes in mid-sprint Jeopardize Work Investment
      • Planning isn't free
      • Work toward discarded/delayed features isn't free
    • Increases Risk
      • Other features may not get delivered
      • Other features may have defects
    • Small duration, usually 2 to 4 weeks, to simplify planning and stablish a regular rhytym
  • Time Boxing
    • Easier planning
    • Detects problems with features sooner
onin's picture

How to create a multiple apache virtual hosts (vhosts) on a virtual machine (VM) that can be accessed from another pc on your local area network (LAN)

  1. Make sure you use "Bridge" config on your Virtual Machine.
    In the sample below, I'm using using VirtualBox.

onin's picture

ShoppingCart using Factory Pattern in PHP

The ProductFactory object will have the knowledge of creating the Keyboard and Mouse. This way it will decouple ShoppingCart from both Keyboard and Mouse and will hide the knowlege of creating these objects from our business logic. Our business logic will be responsible of only keeping the list of products. It will not know how they are made, how are they created and why are they created.
onin's picture

Coding Standards (PSR-0, PSR-1, PSR-2)

Using PSR-0, PSR-1, PSR-2 Standards

Sample code from Symfony's Website

onin's picture

How to install Symfony on a Shared Hosting Server

  • Symfony 2+ require's PHP 5.3.8+
    Most hosting provider allows you to choose the PHP version to use on a particular directory.
    You can check this on your cpanel or ask your hosting support.
  • Go to Symfony's installation folder. 
    eg: /home/user/public_html
$cd /home/user/public_html
  • Edit config.sys found on web/ directory.
    Disable these two lines by commenting them out:
    //header('HTTP/1.0 403 Forbidden');
onin's picture

Javascript Closures

  • Stored in memory until it is set to null.
  • This is a self invoking with anonymous function.
  • The "i" variable is accessible by the closure.
  • Uses object notation.
var utility = (function() {
  var i = 0;

  return {
    nameGen: function() {
      var name = "CustomName" + i;
      i = i + 1;
      return name;
}()); // <- self invoking

var name1 = utility.nameGen(),
    name2 = utility.nameGen();

alert(name1 + " " + name2);
//shows: CustomName0 CustomName1


Sometimes when opportunity comes, it appears in a different form, and from a different direction than expected. That is one of the tricks of opportunity. It has a sly habit of slipping by the back door, and often comes disguised in the form of misfortune or temporary defeat. Perhaps this is why so many fail to recognize opportunity.