Skip to content

Instantly share code, notes, and snippets.

View AlexGx's full-sized avatar

Alexander Gubarev AlexGx

View GitHub Profile
@rybakit
rybakit / bench_swoole.php
Last active December 29, 2021 10:54
tarantool/client swoole
<?php
/**
* This file is part of the Tarantool Client package.
*
* (c) Eugene Leonovich <gen.work@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
@shadz3rg
shadz3rg / gost_engine.sh
Created October 15, 2018 11:19
Настройка ГОСТ OpenSSL под Ubuntu 18.04
# Ubuntu 18.04.1 LTS (GNU/Linux 4.15.0-36-generic x86_64)
# (из коробки) OpenSSL 1.1.0g 2 Nov 2017
# (из коробки) curl 7.58.0 (x86_64-pc-linux-gnu)
# PHP 7.2.10-0ubuntu0.18.04.1 (cli) (built: Sep 13 2018 13:45:02) ( NTS )
# Компилим GOST-engine
sudo apt install cmake libssl-dev
git clone --branch=openssl_1_1_0 https://github.com/gost-engine/engine.git gost-engine/engine
cd gost-engine/engine
cmake .
@tom--
tom-- / Random bytes, ints, UUIDs in PHP.md
Last active February 11, 2023 06:14
PHP random bytes, integers and UUIDs

Random bytes, ints, UUIDs in PHP

Simple and safe random getters to copy-paste

string randomBytes( int $length )

int randomInt ( int $min , int $max )

string randomUuid ( void )
@mat
mat / Readme.markdown
Last active February 19, 2024 07:46
apple-app-site-association —with examples

“apple-app-site-association” file

One file for each domain, both www.example.com and example.com need separate files:

{
    "applinks": {
        "apps": [],
        "details": {
 "9JA89QQLNQ.com.apple.wwdc": {
@believer-ufa
believer-ufa / progress.js
Last active February 27, 2019 11:01
Простой способ запустить прогресс-бар тогда, когда пройдёт пара секунд
Progress = new function() {
this.progressStartTimer = null; // ИД таймера старта прогресс-бара
this.time = 800; // Через сколько милисекунд отобразить прогресс-бар
this.clear = function() {
if (this.progressStartTimer != null) {
clearTimeout(this.progressStartTimer);
}
};
this.start = function() {
this.clear();
@appbak3r
appbak3r / DocxGenerator.php
Last active August 29, 2015 14:10
Create docx file with variables escaped with {variable}
<?php
/**
* Класс для генрации Docx
* User: Алексей Дмитриев
* Date: 10.07.14
* Time: 17:52
*/
class FileConverterDOC extends FileConverter {
@xskif
xskif / ReverseController.php
Last active July 30, 2021 04:26 — forked from bmarston/InitialDbMigrationCommand.php
1) Copy this gist to project/console/controllers. 2) call -- yii reverse/migrate > tmp.migrate.php 3) copy functions to existing migration class.
<?php
namespace console\controllers;
use \Yii;
class ReverseController extends \yii\console\Controller
{
public function actionMigrate() {
// $schema = $args[0];
$tables = Yii::$app->db->schema->getTableSchemas();
@jkovacs618
jkovacs618 / AppActiveQuery.php
Created August 26, 2014 16:17
Yii2 custom AppActiveQuery class used to extend yii\db\ActiveQuery to provide a cache function for backwards-compatibility with Yii 1.1 CActiveRecord->cache.
<?php
namespace common\models\db;
class AppActiveQuery extends \yii\db\ActiveQuery
{
private $cacheDuration = null;
private $functionName = '';
private $q = null;
/**
@mudassir0909
mudassir0909 / selectize_no_results.js
Created July 24, 2014 13:56
A hacky plugin to display "No results found" message on selectize. Don't use this along with "dropdown_header" plugin though.
/*
https://github.com/brianreavis/selectize.js/issues/470
Selectize doesn't display anything to let the user know there are no results.
This is a temporary patch to display a no results option when there are no
options to select for the user.
*/
Selectize.define( 'no_results', function( options ) {
var self = this;