Skip to content

Instantly share code, notes, and snippets.

View oRastor's full-sized avatar
🏠
Working from home

Orest Budzhak oRastor

🏠
Working from home
View GitHub Profile
@oRastor
oRastor / todo.md
Last active October 4, 2019 06:36
xG Game Filter Utility (Public)
  • Возможность указать диапазон для кэфа
  • Добавить в таблицу последний кэф/кэф закрытия
  • Другие типы ставок, включая форы
  • Регулярно обновлять кэфы и хинтом выводить дату последнего обновления
  • Возможность указать диапазон дат
  • Возможность указать диапазон количества минут или долю минут свойства статистики (например xG90 +1)
  • Добавить в таблицу результат расчёта события по МК
  • Возможность сохранять несколько наборов фильтров для аккаунта
@oRastor
oRastor / copy-tables-from-one-db-to-another.php
Created January 4, 2018 06:31
Script for copy data from one mysql database to another by using one connection
<?php
$sourceDbName = 'src';
$destinationDbName = 'dest';
$connection = new PDO('mysql:host=hostname;dbname=' . $sourceDbName, 'user', 'password');
$tables = $connection->query("SHOW TABLES")->fetchAll(PDO::FETCH_COLUMN);
$connection->exec("USE {$destinationDbName}");
foreach ($tables as $tableName) {
@oRastor
oRastor / session-life-cycle.md
Created June 28, 2017 09:43 — forked from mindplay-dk/session-life-cycle.md
Complete overview of the PHP SessionHandler life-cycle

This page provides a full overview of PHP's SessionHandler life-cycle - this was generated by a set of test-scripts, in order to provide an exact overview of when and what you can expect will be called in your custom SessionHandler implementation.

Each example is a separate script being run by a client with cookies enabled.

To the left, you can see the function being called in your script, and to the right, you can see the resulting calls being made to a custom session-handler registed using session_set_save_handler().

@oRastor
oRastor / phone.php
Last active January 18, 2021 17:40
Simple and fast php function to compare two phone numbers
<?php
function isEqualPhoneNumber($phoneA, $phoneB, $substringMinLength = 7)
{
if ($phoneA == $phoneB) {
return true;
}
// remove "0", "+" from the beginning of the numbers
if ($phoneA[0] == '0' || $phoneB[0] == '0' ||