Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
| <?php | |
| /* | |
| * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
| * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
| * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
| * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
| * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
| * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
| * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
| This was a quick & dirty benchmark (for my own needs) to compare the method to get a class name in PHP | |
| -ReflectionObject->getName(); | |
| -get_class(); | |
| -ReflectionClass->getName(); | |
| It was performed on my local machine : MacBookPro with PHP 5.3.6 | |
| You will find the result below and the code used for the 3 tests. | |
| ReflectionObject | |
| Memory : 750040 |
| // Promise.all is good for executing many promises at once | |
| Promise.all([ | |
| promise1, | |
| promise2 | |
| ]); | |
| // Promise.resolve is good for wrapping synchronous code | |
| Promise.resolve().then(function () { | |
| if (somethingIsNotRight()) { | |
| throw new Error("I will be rejected asynchronously!"); |
| #!/bin/bash | |
| ## Install Golang Stable 64Bits on Linux (Debian|Ubuntu|OpenSUSE|CentOS) | |
| ## http://www.linuxpro.com.br/2015/06/golang-aula-1-instalacao-da-linguagem-no-linux.html | |
| ## Run as root (sudo su) | |
| ## Thank's @geosoft1 | @gwmoura | |
| GO_URL="https://go.dev/dl" | |
| GO_VERSION=$(curl -s 'https://go.dev/VERSION?m=text'|head -n1) | |
| GO_FILE="$GO_VERSION.linux-amd64.tar.gz" |
Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...
// see: https://github.com/chadoe/docker-cleanup-volumes
$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
![1552318723273](https://user-images.githubusercontent.com/35657933/541