Skip to content

Instantly share code, notes, and snippets.

@zajca
zajca / JsonSerializerTrait.php
Last active March 22, 2019 09:04
NSP API Guzzle Client
<?php
declare(strict_types=1);
namespace App\Base\Rest;
use Psr\Http\Message\ResponseInterface;
use Symfony\Component\Serializer\Encoder\JsonEncoder;
use Symfony\Component\Serializer\Normalizer\ObjectNormalizer;
use Symfony\Component\Serializer\Serializer;
countdown() {
secs=$1
shift
msg=$@
while [ $secs -gt 0 ]
do
notify-send "Zbývá ti: "$((secs--)) -h string:x-canonical-private-synchronous:anything
sleep 1
done
}
@zajca
zajca / dump_mysql_from_env.sh
Created June 13, 2019 07:13
dump mysql database using query string from .env
#!/bin/bash
source .env
if [ -z "$1" ]
then
echo "Missing file to dump"
exit 1
fi