Avoid console errors in browsers that lack a console.
Excerpted from HTML5 boilerplate:
| /** | |
| * Call a command in background | |
| * | |
| * @param string $command | |
| * @param array $arguments | |
| * | |
| * @return int | |
| */ | |
| public function runCommand($command, $arguments = array(), $logName = 'tvdb.commands') | |
| { |
| sudo port -fp uninstall installed |
| find . | xargs xattr -d com.apple.quarantine |
| sudo dscacheutil -flushcache |
| ssh-keygen -p |
| export XDEBUG_CONFIG="idekey=PHPSTORM" |
| <?php | |
| namespace Acme\HelloBundle\Controller; | |
| use Guzzle\Http\Client; | |
| use Guzzle\Http\Exception\BadResponseException; | |
| public function someAction() | |
| { |
| # List the 10 biggest directory in the current directory | |
| sudo du -hsx * | sort -rh | head -10 |
Avoid console errors in browsers that lack a console.
Excerpted from HTML5 boilerplate:
| /** | |
| * @return string | |
| */ | |
| protected function generateCode() | |
| { | |
| $length = 8; | |
| $code = ""; | |
| $possible = "2346789234567891234567892345678923456789234567892345678923456789234567892345678923456789abcdfghjkmnpqrtvwxyzABCDFGHJKLMNPQRTVWXYZ"; | |
| $maxlength = strlen($possible); |