Skip to content

Instantly share code, notes, and snippets.

@livsi
livsi / proposal.md
Created September 14, 2022 13:36 — forked from dalelane/proposal.md
Describing Kafka schema usage using AsyncAPI
@livsi
livsi / .golangci.yml
Created June 21, 2022 18:50 — forked from kulti/.golangci.yml
golangci-lint config workflow
# Comments started with [!] are explanations of my workflow with gitlabci-lint.
# Another comments are real comments in my config.
# [!] Examine the https://golangci-lint.run/usage/configuration/ to know all possibilities.
run:
timeout: 5m
modules-download-mode: vendor # [!] if you are using vendoring
build-tags:
- integration # [!] If you disable code for integration tests to run all unit tests, enable it to lint all the same.
@livsi
livsi / real-time-php-fpm-status.md
Created April 28, 2022 14:44 — forked from Jiab77/real-time-php-fpm-status.md
Real-time PHP-FPM Status

Real-time PHP-FPM Status

This gist will explain you how to enable an undocumented feature of PHP-FPM which will give a real-time performance stats.

Everybody knows the famous phpinfo() and the page it generates, right? Then the real-time PHP-FPM status page design is very similar.

image

Some informations from the top are not displayed to avoid security issues.

Enable PHP-FPM Status

@livsi
livsi / Badoo PHP Russia 2019 talk.md
Created May 20, 2019 15:10 — forked from pmurzakov/Badoo PHP Russia 2019 talk.md
Badoo PHP performance -- useful links and snippets -- PHP Russia 2019 talk
@livsi
livsi / P12toPEM.txt
Created August 24, 2018 13:36 — forked from shahdhiren/P12toPEM.txt
Convert P12 file for Push Notification to PEM format
Development Phase:
Step 1: Create Certificate .pem from Certificate .p12
Command: openssl pkcs12 -clcerts -nokeys -out apns-dev-cert.pem -in apns-dev-cert.p12
Step 2: Create Key .pem from Key .p12
Command : openssl pkcs12 -nocerts -out apns-dev-key.pem -in apns-dev-key.p12
Step 3: Optional (If you want to remove pass phrase asked in second step)
Command : openssl rsa -in apns-dev-key.pem -out apns-dev-key-noenc.pem
@livsi
livsi / SomeAdmin.php
Last active April 6, 2018 13:15
sonata date range field and fixed choice list
<?php
....
protected function configureDatagridFilters(DatagridMapper $datagridMapper)
{
$keys = [1,2,3];
$choiceOptions = array_combine(keys, keys);
$datagridMapper
->add('fooType', null, ['show_filter' => true], 'choice', ['choices' => $choiceOptions])
->add('bazType', 'doctrine_orm_date_range', array(
@livsi
livsi / MenuBuilderListener.php
Last active April 2, 2018 10:56
Logout link in sonata admin
<?php
namespace App\EventSubscriber;
use Sonata\AdminBundle\Event\ConfigureMenuEvent;
class MenuBuilderListener
{
public function addMenuItems(ConfigureMenuEvent $event)
{
@livsi
livsi / awesome_things.rst
Last active March 30, 2018 09:45
Awesome things