Skip to content

Instantly share code, notes, and snippets.

@khoand0000
khoand0000 / install-php7-pear-mysql-php-codesniffer-homebrew.md
Last active May 23, 2018 14:57
install php7, pear, mysql, PHP_CodeSniffer by homebrew

Install php7 with pear

$ brew tap homebrew/dupes
$ brew tap homebrew/versions
$ brew tap homebrew/homebrew-php
$ brew install php70 --with-pear

Enable php7 with apache2

@khoand0000
khoand0000 / code-style-when-using-underscore.md
Last active January 12, 2016 09:24
Code style when using underscore in php
  • I am using the php underscore
  • Use closures and assign them to variables
  • Put variables at begin of the function, main code will after ////////
  • Must be
function sumPrice($items) {
  $sum = function ($memo, $item) {
    return $memo + $item['price'];
 }
@khoand0000
khoand0000 / what-is-promise.md
Last active January 12, 2016 02:34
What is promise?