Recent Articles and Tutorials

Git display info of last commit (HEAD) in one line

Display last commit info from head in one line $ git log –pretty=format:”%h|%an|%ad|%s” -1 97d79ec|Dave Methvin|Mon Nov 9 17:49:01 2015 -0500|Dimensions: Empty sets should return read more

Git – display specific length commit hash

Display last commit from head to with specific commit hash length $ git log –pretty=format:”%h” –abbrev=7 -1 97d79ec

Git – Check if a hash is valid

Use git show and check for exit status $ git show -s 97d79ecf6b6 commit 97d79ecf6b6c5cc3c1485eb3c46e12986a978f57 Author: Dave Methvin Date: Mon Nov 9 17:49:01 2015 -0500 read more

Git show details of a commit hash

show a commit details (without file diff) $ git show -s 97d79ecf6b6 commit 97d79ecf6b6c5cc3c1485eb3c46e12986a978f57 Author: Dave Methvin Date: Mon Nov 9 17:49:01 2015 -0500 Dimensions: read more

Git log with file names

git log with name $ git log –name-status … git log with name (one entry) $ git log –name-status -1 commit fbf829b7245f7d76ea02a44ab0a62427214b7575 Author: Timmy Willison read more

PHP print number to two decimal places

Print a number/float in php to two decimal places:

PHP elapsed time

Find elapsed time in php using microtime.

Git delete branch

Delete local branch $ git branch -d BRANCHNAME ## list branches $ git branch

Git create branch

Create branch without switching $ git branch NEWBRANCHNAME ## list branches $ git branch Create branch and switch to it $ git checkout -b NEWBRANCHNAME read more

Linux find – ignore case in name

When using linux find, -iname can be used to match name pattern and ignore case (case insensitive). $ fine . -iname “pattern” Example Find all read more