Skip to content

Instantly share code, notes, and snippets.

View flug's full-sized avatar
:octocat:
yeah yeah yeah

Flug flug

:octocat:
yeah yeah yeah
View GitHub Profile
@webdevilopers
webdevilopers / AgencyPublisher.php
Created June 6, 2020 09:16
Symfony Messenger - Subscribing multiple Handlers to Messages
<?php
namespace Acme\TemporaryWork\Infrastructure\ProcessManager;
use OldSound\RabbitMqBundle\RabbitMq\ProducerInterface;
use Prooph\EventSourcing\AggregateChanged;
use Acme\TemporaryWork\Domain\Model\Agency\Event\AgencyHired;
use Acme\TemporaryWork\Domain\Model\Agency\Event\AgencyModified;
use Acme\PersonnelManagement\Infrastructure\RabbitMq\Producer;
use Symfony\Component\Messenger\Handler\MessageSubscriberInterface;
@chronon
chronon / ext.txt
Created February 18, 2017 15:38
List of docker-php-ext-install extension names
Possible values for ext-name:
bcmath
bz2
calendar
ctype
curl
dba
dom
enchant
@is-just-me
is-just-me / test_functions.php
Last active November 15, 2022 07:36
Create combinations,products and update stock with Prestashop WEBSERVICE
<?php
function add_combination($data){
global $webService, $config;
try{
$xml = $webService->get(array('url' => $config["ps_shop"].'api/combinations?schema=blank'));
$combination = $xml->children()->children();
$combination->associations->product_option_values->product_option_values[0]->id = $data["option_id"];
$combination->reference = $data["code"];
$combination->id_product = $data["id_product"];
<?php
namespace MyBundle\Bundle\FrontendBundle\Twig\Loader;
use MyBundle\Bundle\FrontendBundle\Twig\MobileDetect;
use Symfony\Bundle\FrameworkBundle\Templating\Loader\FilesystemLoader;
use Symfony\Component\Config\FileLocatorInterface;
use Symfony\Component\Filesystem\Filesystem;
@jackl0phty
jackl0phty / aws-s3-policy-minimum-privs.txt
Created November 16, 2015 23:05
How to Create an AWS S3 Bucket, tag it, Specify Region, & Enable Versioning Using Ansible.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "statement1",
"Effect": "Allow",
"Action": [
"s3:Put*",
"s3:Get*",
"s3:List*",
<?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;
@roukmoute
roukmoute / Exception.php
Last active August 30, 2016 16:58
Exception with possibility to use a formatted string
<?php
namespace Exception;
class Exception extends \Exception
{
/**
* @param string $message
* @param string|array $arguments
* @param int $code
* @param Exception|null $previous
@BaptisteDixneuf
BaptisteDixneuf / OVH_Public_Cloud_Storage_API_OpenStack_Swift.md
Created June 25, 2015 21:23
OVH Public Cloud Object Storage et API OpenStack Swift
@Heolink
Heolink / hddProbe.sh
Last active August 29, 2015 14:23
HDD Probe
#!/bin/bash
# Pour rendre le fichier executable
# chmod +x hddProb.sh
#
# cron toute les 30 minutes avec pour limite d'usage 60 par défaut si non définit c'est à 90%
# crontab -e */30 * * * * /chemindemonscript/hddProb.sh -l=60
#
#le hostname de la machine
@flug
flug / composer-update.sh
Last active August 29, 2015 14:07
dynamize
function composer-update (){
echo "-- composer update --"
$(which hhvm) $(which composer) self-update
$(which hhvm) $(which composer) update -vvv --profile --no-scripts && $(which php) $(which composer) run-script post-update-cmd
echo "-- composer update end --"
}