Archive for March, 2014


Learn all the Git features

Ok, so maybe you can commit, push, pull, branch, and maybe have even set up some post-hookery! But Git has lots more I haven’t even touched yet!

This looks really nice, so I thought I’d share it with you all! Check it out!

http://pcottle.github.io/learnGitBranching/

This is remarkably simple! You’ve seen shell scripts that start with #!/bin/bash ? Well check this!
Create a file, call it anything, no need for php extension!

#!/usr/bin/env php
<?php
      echo "Easy as that!\n";

Then make it executable:

chmod +x myfile

Then you can run it with ./myfile ! Not hard at all! Now you can also pass arguments like so:

./myfile --option1=value1 --option2

With or without values. To do this, we add the following:

foreach ($argv as $arg)
{
    preg_match('/\-\-(\w*)\=?(.+)?/', $arg, $value);
    if ($value && isset($value[1]) && $value[1])
    {
       $options[$value[1]] = isset($value[2]) ? $value[2] : null;
    }
}

Now you have access to $options[‘youroption’]; Have fun and play around with it!