Skip to content

Instantly share code, notes, and snippets.

View Sekaiichi's full-sized avatar
I may be slow to respond.

Mehrubon Sekaiichi

I may be slow to respond.
View GitHub Profile
<?php
/*
* This file is part of jwt-auth.
*
* (c) Sean Tymon <tymon148@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
<?php
$uri = 'https://music.yandex.ru/handlers/playlist.jsx?owner=Sekaiichi8&kinds=3';
$responseRaw = file_get_contents($uri);
$response = json_decode($responseRaw);
$playlistTitle = $response->playlist->title;
$tracks = $response->playlist->tracks;
file_exists($playlistTitle . '.txt') ? unlink($playlistTitle . '.txt') : null;
FROM php:7.1.3-fpm-alpine
MAINTAINER Mehrubon Khusaynov <husaynov888@gmailc.com>
ENV TIMEZONE Asia/Dushanbe
RUN apk upgrade --update && apk --no-cache add \
autoconf tzdata file g++ gcc binutils isl libatomic libc-dev musl-dev make re2c libstdc++ libgcc libcurl curl-dev binutils-libs mpc1 mpfr3 gmp libgomp coreutils freetype-dev libjpeg-turbo-dev libltdl libmcrypt-dev libpng-dev openssl-dev libxml2-dev expat-dev postgresql-dev ffmpeg \
&& docker-php-ext-install -j$(nproc) iconv mysqli pdo pdo_mysql curl bcmath mcrypt mbstring json xml zip opcache pdo_pgsql pgsql \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
<?php
namespace App;
Class Download{
private function downloadFile($title, $link, $saveLink, $folderName, $i)
{
ob_start();
$nameOld = $link . $title . $i .'.mp4';
<?php
namespace App;
Class Download{
private function downloadFile($title, $link, $saveLink, $folderName, $i)
{
ob_start();
$nameOld = $link . $title . $i .'.mp4';
<?php
/* @var $this yii\web\View */
/* @var $model app\controllers\SiteController */
/* @var $spend app\controllers\SiteController */
use app\components\Api;
use app\components\UsefulStuff;
$this->title = 'Главная страница';
$getSpending = $model['spend'];
$beeUsage = 0; $otherUsage = 0; $mbUsage = 0; $otherSms = 0;
if($getSpending['status'] == 200){
<?php
/**
* Created by PhpStorm.
* User: Mkhusaynov
* Date: 10/26/2018
* Time: 10:56 AM
*/
namespace app\commands;
use yii\console\Controller;
<?php
$dbh = new \PDO('oci:dbname=' . "(DESCRIPTION =(ADDRESS = (PROTOCOL= TCP)(Host= host)(Port= port))(CONNECT_DATA = (SID = host)))" . ';charset=UTF8', $db_user, $db_psw);
$stmt = $dbh->prepare('Select * from user.tbl_api_beeline where PASSPORT is NOT NULL and ROWNUM <= 10000');
$stmt->execute();
$rows = $result = $stmt->fetchAll(PDO::FETCH_ASSOC);
$data = array_chunk($rows, 1000);
/*echo "<pre>";
var_dump($data);
@Sekaiichi
Sekaiichi / Nginx-1.12_vhost.conf
Created July 25, 2018 10:38
Yii2 basic ngnix OSPanel(OpenServer) cofiguration
#-----------------------------------------------#
# ������ ����� ������������ �����
#-----------------------------------------------#
server {
listen %ip%:%httpport%;
listen %ip%:%httpsport% ssl;
server_name %host% %aliases%;
root "%hostdir%/web";
@Sekaiichi
Sekaiichi / encrypt_and_decrypt.php
Created May 6, 2018 11:55
encrypt and decrypt php
<?php
function dec_enc($action, $string) {
$output = false;
$encrypt_method = "AES-256-CBC";
$secret_key = 'This is my secret key';
$secret_iv = 'This is my secret iv';
// hash
$key = hash('sha256', $secret_key);