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.
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 | |
namespace Your\Bundle\Misc; | |
class SluggableListener extends \Gedmo\Sluggable\SluggableListener | |
{ | |
public function __construct(){ | |
$this->setTransliterator(array('\Your\Bundle\Misc\Transliterator', 'transliterate')); | |
} |
id, field1, field2, field3 | |
{% for row in data %} | |
{{ row.id }},{{ row.field1 }},{{ row.field2 }},{{ row.field3 }} | |
{% endfor %} |
<?php | |
namespace App\Controller\Website; | |
use Sulu\Bundle\WebsiteBundle\Controller\WebsiteController; | |
use Sulu\Component\Content\Compat\StructureInterface; | |
/** | |
* Controller which needs a custom service to add data to render twig template. | |
*/ |
/* | |
Stores entries in a local SQLite database | |
until they have been processed by a submit function. | |
*/ | |
package journal | |
import ( | |
"database/sql" | |
_ "github.com/mattn/go-sqlite3" | |
"sync" |
<?php | |
declare(strict_types = 1); | |
namespace Acme\Infrastructure\MongoDb; | |
use MongoDB\Client; | |
use MongoDB\Collection; | |
class MongoConnection |
# Install K3S | |
curl -sfL https://get.k3s.io | sh - | |
# Copy k3s config | |
mkdir $HOME/.kube | |
sudo cp /etc/rancher/k3s/k3s.yaml $HOME/.kube/config | |
sudo chmod 644 $HOME/.kube/config | |
# Check K3S | |
kubectl get pods -n kube-system |
<?php | |
# tests/bootstrap.php | |
declare(strict_types=1); | |
namespace App\Test; | |
use ApiPlatform\Core\Bridge\Symfony\Bundle\Test\Client; | |
use App\Entity\User; | |
use App\Kernel; |