Archive for April 2017

Git using subtree

1. Adding subtree to current project git remote add mysubproject git@github.com:iaghayev/mysubproject.git   git subtree add –prefix=path/to/somedir mysubproject master 2. Committing changes to subproject from path/to/somedir folder git subtree push –prefix=path/to/somedir mysubproject master 3. Getting latest code changes from subproject git subtree pull –prefix=path/to/somedir mysubproject master

Passport validation :: check digit example

  <?php   function calcCheckDigit($inputCode) { $btArray = str_split($inputCode); $total = 0;   for ($index = 0; $index < sizeof($btArray); $index++) { $btChr = ord($btArray[$index]);   if ($btChr == 60) { //convert spacer char < to 0 $btArray[$index] = 0; } else if ($btChr >= 65) { //convert letters A-Z to 10-35 $btArray[$index] = $btChr […]