Skip to content

Instantly share code, notes, and snippets.

Avatar

Jáchym Toušek enumag

View GitHub Profile
@enumag
enumag / readme.md
Created March 30, 2022 11:34
PHP Segmentation fault debugging
@enumag
enumag / cloud_batch_logging.php
Last active January 27, 2022 13:26
cloud_batch_logging.php
View cloud_batch_logging.php
<?php declare(strict_types = 1);
use Google\Cloud\Logging\LoggingClient;
use Google\CloudFunctions\FunctionsFramework;
use GuzzleHttp\Psr7\Response;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
FunctionsFramework::http(
'entrypoint',
@enumag
enumag / cloud_logging.php
Last active January 27, 2022 13:06
[Medium] Logging in Cloud Functions
View cloud_logging.php
<?php declare(strict_types = 1);
use Google\Cloud\Logging\LoggingClient;
$client = new LoggingClient(['projectId' => $projectId]);
$logger = $client->psrLogger(
'app',
[
'resource' => [
'type' => 'cloud_function',
@enumag
enumag / 01 Create a debug version of the docker image.sh
Created December 10, 2020 19:41 — forked from sh41/01 Create a debug version of the docker image.sh
Debugging segmentation faults in PHP in a docker container.
View 01 Create a debug version of the docker image.sh
git clone git@github.com:docker-library/php.git docker-library-php
## Go to the specific version you're interested in
cd docker-library-php/7.1/fpm/alpine
## Edit the .Dockerfile.
## Change
## ENV PHP_EXTRA_CONFIGURE_ARGS --enable-fpm --with-fpm-user=www-data --with-fpm-group=www-data
## to
## ENV PHP_EXTRA_CONFIGURE_ARGS --enable-fpm --with-fpm-user=www-data --with-fpm-group=www-data --enable-debug
## Comment out or delete:
@enumag
enumag / MigrationsUpToDateTest.php
Created March 1, 2019 08:10
Doctrine schema tests
View MigrationsUpToDateTest.php
<?php declare(strict_types = 1);
namespace App\Core\Tests\Infrastructure\Doctrine;
use App\Library\Test\KernelTestCase;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Output\BufferedOutput;
final class MigrationsUpToDateTest extends KernelTestCase
@enumag
enumag / OrderedCollection.php
Created November 29, 2018 12:11
OrderedCollection
View OrderedCollection.php
<?php declare(strict_types=1);
namespace App\Library\DataStructures;
use Ds\Vector;
use Iterator;
use IteratorAggregate;
final class OrderedCollection implements IteratorAggregate
{
@enumag
enumag / DeferredExplicitTrackingPolicySubscriber.php
Created October 14, 2018 20:41
DeferredExplicitTrackingPolicySubscriber
View DeferredExplicitTrackingPolicySubscriber.php
<?php declare(strict_types = 1);
namespace App\Library\Doctrine\Subscriber;
use Doctrine\Common\EventSubscriber;
use Doctrine\ORM\Event\LoadClassMetadataEventArgs;
use Doctrine\ORM\Events;
use Doctrine\ORM\Mapping\ClassMetadata;
final class DeferredExplicitTrackingPolicySubscriber implements EventSubscriber
@enumag
enumag / UnityPosFinder.py
Created August 22, 2018 04:54 — forked from TellowKrinkle/UnityPosFinder.py
Correlates offsets with object IDs in unity asset files
View UnityPosFinder.py
import sys
import unitypack
from unitypack.asset import Asset
if len(sys.argv) < 3:
print("Usage: " + sys.argv[0] + " assetfile.assets (offset | offsetfile.txt)\nOffset file formatting: per line \"offset [printout name]\"")
exit()
try:
targetOffsets = [[int(sys.argv[2], 0), sys.argv[2]]]
@enumag
enumag / MemoryListener.php
Created June 20, 2017 15:59
MemoryListener for PHPUnit
View MemoryListener.php
<?php
declare(strict_types=1);
namespace Tests\Listener;
use PHPUnit\Framework\BaseTestListener;
use PHPUnit\Framework\Test;
class MemoryListener extends BaseTestListener
View gist:94c172d180bb291e79992becd241b8dd
mobil - hlavička moc velká
mobil - vypnout popup
mobil - na detailu košík před popis, nadpis na obrázkem
kontakt - přidat mapu
menu - hover
analytics - cíl na konverzní poměr
hledání - obrázky, css kategorie