This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace My\Bundle\EventListener; | |
use My\Bundle\User\User; | |
use Symfony\Component\Routing\Router; | |
use Symfony\Component\Security\Http\Event\InteractiveLoginEvent; | |
class InteractiveLoginListener | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in 50 100 250 500; do echo "String length: $i"; php strcmpbench.php $i; php strcasecmpbench.php $i; echo "\n"; done | |
# Example run: | |
# | |
# String length: 50 | |
# ************************ | |
# * strcomp + strtolower * | |
# ************************ | |
# Time: 0.000082 | |
# Memory: 1456 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Buzz\Listener\ListenerInterface; | |
use Buzz\Message\MessageInterface; | |
use Buzz\Message\RequestInterface; | |
class JsonListener implements ListenerInterface | |
{ | |
/** | |
* {@inheritdoc} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Collections; | |
use Doctrine\Common\Collections\ArrayCollection; | |
use Symfony\Component\PropertyAccess\PropertyAccess; | |
class ExtendedArrayCollection extends ArrayCollection | |
{ | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Recursively takes the specified criteria and adds too the expression. | |
* | |
* The criteria is defined in an array notation where each item in the list | |
* represents a comparison <fieldName, operator, value>. The operator maps to | |
* comparison methods located in ExpressionBuilder. The key in the array can | |
* be used to identify grouping of comparisons. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Specify directories under /client/src to be copied directly | |
COPYDIRS = lib img | |
client: copy client/build/js/app.js client/build/css/app.css | |
clean: | |
rm -Rf client/build | |
rebuild: clean client |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Acme\Serializer\Normalizer; | |
use Doctrine\Common\Collections\ArrayCollection; | |
use Doctrine\Common\Collections\Collection; | |
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; | |
use Symfony\Component\Serializer\Normalizer\NormalizerInterface; | |
use Symfony\Component\Serializer\Normalizer\SerializerAwareNormalizer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
systemctl stop docker | |
# kill all old images etc | |
rm -rf /var/lib/docker | |
# change the startup options for docker service | |
mkdir /etc/systemd/system/docker.service.d | |
cd /etc/systemd/system/docker.service.d | |
vi storage.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
axios({ | |
url: 'http://localhost:5000/static/example.pdf', | |
method: 'GET', | |
responseType: 'blob', // important | |
}).then((response) => { | |
const url = window.URL.createObjectURL(new Blob([response.data])); | |
const link = document.createElement('a'); | |
link.href = url; | |
link.setAttribute('download', 'file.pdf'); | |
document.body.appendChild(link); |