Skip to content

Instantly share code, notes, and snippets.

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

Sergey Elizov elizov

🏠
Working from home
  • Kharkov, Ukraine
View GitHub Profile
@elizov
elizov / device.php
Last active April 28, 2016 08:36
Определить iOS/Android
<?php
function getDevice(){
$device = [];
if(preg_match('/(iPhone|iPod|iPad|Android)/', $_SERVER['HTTP_USER_AGENT'], $device)){
return $device[0];
}
return '';
}
@elizov
elizov / mysql.sql
Created January 16, 2019 10:27
UPDATE FROM SELECT
UPDATE user_assets AS ua
INNER JOIN (
SELECT
ua.user_id,
ua.instance_id,
uas.state,
uas.payload,
uas.history
FROM user_assets AS ua
LEFT JOIN user_asset_states AS uas ON uas.user_id = ua.user_id AND uas.instance_id = ua.instance_id
<?php
namespace App\Rules;
use Illuminate\Contracts\Validation\Rule;
use FFMpeg\FFMpeg;
class MaxVideoBitRate implements Rule
{
protected $maxBitRate;
<?php
namespace App\Http\Requests;
use App\Rules\MaxVideoBitRate;
use Illuminate\Foundation\Http\FormRequest;
class VideoUploadRequest extends FormRequest
{
/**
@elizov
elizov / tunnel.sh
Created June 24, 2020 03:26
MySQL tunnel to remote server
ssh -N -L 3306:127.0.0.1:3306 [USER]@[SERVER_IP]
@elizov
elizov / composer.sh
Last active August 6, 2021 07:55
Composer install via docker
# composer install via docker
$ docker run --rm -v $(pwd):/app composer:latest install --ignore-platform-reqs
@elizov
elizov / proxy-check.sh
Created January 13, 2023 15:50
Check proxy via curl
curl \
--proxy proxy_host:proxy_port \
--proxy-user proxy_user:proxy_pass \
https://lumtest.com/myip.json