Skip to content

Instantly share code, notes, and snippets.

@asagajda
asagajda / poll.js
Created August 24, 2022 10:32
Poll VisaMetric for slots
const departureDate = '2022-10-01';
const snd = new Audio("data:audio/wav;base64,//uQRAAAAWMSLwUIYAAsYkXgoQwAEaYLWfkWgAI0wWs/ItAAAGDgYtAgAyN+QWaAAihwMWm4G8QQRDiMcCBcH3Cc+CDv/7xA4Tvh9Rz/y8QADBwMWgQAZG/ILNAARQ4GLTcDeIIIhxGOBAuD7hOfBB3/94gcJ3w+o5/5eIAIAAAVwWgQAVQ2ORaIQwEMAJiDg95G4nQL7mQVWI6GwRcfsZAcsKkJvxgxEjzFUgfHoSQ9Qq7KNwqHwuB13MA4a1q/DmBrHgPcmjiGoh//EwC5nGPEmS4RcfkVKOhJf+WOgoxJclFz3kgn//dBA+ya1GhurNn8zb//9NNutNuhz31f////9vt///z+IdAEAAAK4LQIAKobHItEIYCGAExBwe8jcToF9zIKrEdDYIuP2MgOWFSE34wYiR5iqQPj0JIeoVdlG4VD4XA67mAcNa1fhzA1jwHuTRxDUQ//iYBczjHiTJcIuPyKlHQkv/LHQUYkuSi57yQT//uggfZNajQ3Vmz+Zt//+mm3Wm3Q576v////+32///5/EOgAAADVghQAAAAA//uQZAUAB1WI0PZugAAAAAoQwAAAEk3nRd2qAAAAACiDgAAAAAAABCqEEQRLCgwpBGMlJkIz8jKhGvj4k6jzRnqasNKIeoh5gI7BJaC1A1AoNBjJgbyApVS4IDlZgDU5WUAxEKDNmmALHzZp0Fkz1FMTmGFl1FMEyodIavcCAUHDWrKAIA4aa2oCgILEBupZgHvAhEBcZ6joQBxS76AgccrFlczBvKLC0QI2cBoCFvfTDAo7eoOQInqDPBtvrDEZBNYN5xwNwxQRfw8ZQ5wQVLvO8OYU+mHvFLlDh05Mdg7BT6YrRPpCBznMB2r//xKJjyyOh+cImr2/4doscwD6neZjuZR4AgAABYAAAABy1xcdQtxYBYYZdifkUDgzzXaXn98
@asagajda
asagajda / delete-container-logs.sh
Created November 14, 2018 10:14
Delete docker container's logs one-liner
echo "" > $(docker inspect --format='{{.LogPath}}' <container_name_or_id>)
@asagajda
asagajda / gist:fa00b4b5d704daec0c5227de6f06cbf4
Created July 4, 2018 06:12
Run apache2 over current directory with static html
docker run -dit --name my-apache-app -p 8080:80 -v "$PWD":/usr/local/apache2/htdocs/ httpd:2.4
@asagajda
asagajda / prepare-prod.sh
Created May 2, 2018 16:23
Get tar.gz with renaming dir to include git current hash in dirname
tar cvzf dist-dd-mm-yyyy.tar.gz dist --transform s/dist/dist-$(git rev-parse HEAD | cut -c 1-7)/
0x598739b9E8370f2bf053453a859Cf4Ca6C32c8de
@asagajda
asagajda / UserRepository.php
Last active December 19, 2015 14:59
Add this to repository
<?php
public function getFilteredCount(array $get)
{
/* DB table to use */
$tableObjectName = 'YourBundle:Entity';
$cb = $this->getEntityManager()
->getRepository($tableObjectName)
->createQueryBuilder($alias)
->select("count(a.id)");