Skip to content

Instantly share code, notes, and snippets.

View semivori's full-sized avatar

Vlad Osadchy semivori

  • Ukraine, Sumy
View GitHub Profile
@semivori
semivori / setup.md
Last active August 26, 2024 06:48
copilot symfony docker w frankenphp

Sure, here is the final Docker configuration for a Symfony 7.0 project with PHP 8.2, MySQL, Adminer, and FrankenPHP, including the necessary PHP extensions and a command for database creation.

First, the Dockerfile:

# Dockerfile
FROM php:8.2-fpm

# Install Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
@semivori
semivori / json-dump-val.php
Last active August 8, 2024 13:23
Adminer extension json dump val
<?php
/** Display JSON values as table in edit
* @link https://www.adminer.org/plugins/#use
* @author Jakub Vrana, https://www.vrana.cz/
* @author Martin Zeman (Zemistr), http://www.zemistr.eu/
* @license https://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license https://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
*/
@semivori
semivori / getBrowser.php
Created June 11, 2021 08:11 — forked from james2doyle/getBrowser.php
a PHP function to sniff the user agent of the browser and return a nice object with all the information
<?php
// http://www.php.net/manual/en/function.get-browser.php#101125
function getBrowser() {
$u_agent = $_SERVER['HTTP_USER_AGENT'];
$bname = 'Unknown';
$platform = 'Unknown';
$version= "";
// First get the platform?
if (preg_match('/linux/i', $u_agent)) {
@semivori
semivori / my_parse_str.php
Created January 11, 2021 05:38 — forked from rubo77/my_parse_str.php
This is a replacement for the original idea how to cirumvent the max_input_vars limitation, that uses the original parse_str() on each element of the query to parse
<?php
/**
* do the same than parse_str without max_input_vars limitation:
* Parses $string as if it were the query string passed via a URL and sets variables in the current scope.
* @param $string array string to parse (not altered like in the original parse_str(), use the second parameter!)
* @param $result array If the second parameter is present, variables are stored in this variable as array elements
* @return bool true or false if $string is an empty string
*
@semivori
semivori / h.exe
Created August 30, 2020 19:14
yii helper
#!/usr/bin/env php
<?php
$config = require __DIR__ . '/h-config.php';
$yiiPath = $config['yii_path'] ?? './yii';
/**
* Создает файл миграции и открывает его в редакторе кода, установленном по умолчанию
*
* @param string $name - имя миграции
| resource | resource type | url |
|--------------------------------------------------------|--------------------|--------------------------------------------------|
| anonymous-proxy | http, https | https://free-proxy-list.net/anonymous-proxy.html |
| free-proxy-list | http, https | https://free-proxy-list.net |
| proxy-daily-http proxy-daily-socks4 proxy-daily-socks5 | http socks4 socks5 | http://www.proxy-daily.com |
| socks-proxy | socks4, socks5 | https://www.socks-proxy.net |
| ssl-proxy | https | https://www.sslproxies.org |
| uk-proxy | http, https | https://free-proxy-list.net