Skip to content

Instantly share code, notes, and snippets.

View pavel-rossinsky's full-sized avatar
๐Ÿฆ‰

Pavel Rossinsky pavel-rossinsky

๐Ÿฆ‰
View GitHub Profile
@pavel-rossinsky
pavel-rossinsky / README.md
Last active February 16, 2025 10:46
Cleanup Old Docker Images in GHCR

๐Ÿš€ GitHub Actions Workflow: Build, Push & Cleanup GHCR Docker Images

This GitHub Actions workflow automates building, pushing, and cleaning up Docker images in GitHub Container Registry (GHCR).

๐Ÿ“œ Workflow Steps

  1. Triggers on
    • Pushes to the master branch.
    • Pull requests to master.
    • Manual workflow dispatch.
@pavel-rossinsky
pavel-rossinsky / fcgi_debug.php
Last active February 7, 2025 11:44
The PHP script connects to a PHP-FPM service via FastCGI protocol for debugging purposes. It allows you to send a request to PHP-FPM, execute a script, and retrieve the output when other debugging tools are unavailable.
<?php
$url = '/path/to/script.php';
$env = [
'REQUEST_METHOD' => 'GET',
'SCRIPT_FILENAME' => $url,
];
$service_port = 9000;
$address = '127.0.0.1';
@pavel-rossinsky
pavel-rossinsky / clear_sqs_queues.php
Last active November 14, 2024 17:21
PHP script to list and purge all queues in a local ElasticMQ instance running on Docker. It uses Symfony's HttpClient to interact with the service, sending ListQueues and PurgeQueue requests, and outputs the results to the console.
<?php
use Symfony\Component\HttpClient\HttpClient;
require __DIR__ . '/vendor/autoload.php';
$client = HttpClient::create();
$endpoint = 'http://localhost:9424';
try {
@pavel-rossinsky
pavel-rossinsky / generator.php
Created March 2, 2024 16:06 โ€” forked from tawfekov/generator.php
Doctrine2 Generate Entities form Existing Database
<?php
include '../vendor/autoload.php';
$classLoader = new \Doctrine\Common\ClassLoader('Entities', __DIR__);
$classLoader->register();
$classLoader = new \Doctrine\Common\ClassLoader('Proxies', __DIR__);
$classLoader->register();
// config
$config = new \Doctrine\ORM\Configuration();
@pavel-rossinsky
pavel-rossinsky / php speed up tips.html
Created October 17, 2021 21:56 โ€” forked from bsalim/php speed up tips.html
63 Tips for speeding up PHP
<html>
<body>
<p>Here are Webberโ€™s points:</p>
<ul>
<li>If a method can be static, declare it static. Speed improvement is by a factor of 4.</li>
<li>echo is faster than print.(<em>* compare with list from phplens by John Lim</em>)</li>
<li>Use echoโ€™s multiple parameters instead of string concatenation.</li>
<li>Set the maxvalue for your for-loops before and not in the loop.</li>
<li>Unset your variables to free memory, especially large arrays.</li>
<li>Avoid magic like __get, __set, __autoload</li>
@pavel-rossinsky
pavel-rossinsky / gist:b130c1f7b13a9332318d69e185a998d8
Created April 26, 2020 20:09 โ€” forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: ๐Ÿ˜„ :smile: ๐Ÿ˜† :laughing:
๐Ÿ˜Š :blush: ๐Ÿ˜ƒ :smiley: โ˜บ๏ธ :relaxed:
๐Ÿ˜ :smirk: ๐Ÿ˜ :heart_eyes: ๐Ÿ˜˜ :kissing_heart:
๐Ÿ˜š :kissing_closed_eyes: ๐Ÿ˜ณ :flushed: ๐Ÿ˜Œ :relieved:
๐Ÿ˜† :satisfied: ๐Ÿ˜ :grin: ๐Ÿ˜‰ :wink:
๐Ÿ˜œ :stuck_out_tongue_winking_eye: ๐Ÿ˜ :stuck_out_tongue_closed_eyes: ๐Ÿ˜€ :grinning:
๐Ÿ˜— :kissing: ๐Ÿ˜™ :kissing_smiling_eyes: ๐Ÿ˜› :stuck_out_tongue:
@pavel-rossinsky
pavel-rossinsky / gpg_keys.md
Last active April 26, 2020 10:57
Commit Signature Verification. GPG keys.

Managing commit signature verification on Mac. The way to auto sign-commits.

Generating a new GPG key

  1. Check if gpg2 is installed, run which gpg2 if the command outputs nothing, install GPG Keychain.
  2. Using the GPG Keychain utility generate a new key pair.
  3. In the GPG Keychain, export the public key, save it to your documents folder.
  4. Login to your GitHub account and navigate to https://github.com/settings/keys.
  5. Open the exported public key and copy its contents.
  6. Get back to GitHub, press the "New GPG key" button and paste the copied key.
  7. Run git config --global gpg.program gpg2, to make sure git uses gpg2 and not gpg.