Skip to content

Instantly share code, notes, and snippets.

View exileed's full-sized avatar
🎵
NP: North Star of Nija (Orbit Culture) (3:25/5:14)

Dmitriy Kuts exileed

🎵
NP: North Star of Nija (Orbit Culture) (3:25/5:14)
View GitHub Profile
<?php
interface ClientInterface{
// mentods
public link():string;
}
class ClientServer1 implements ClientInterface{
<?php
namespace App\Events\AddUserEvent;
use Illuminate\Queue\SerializesModels;
class AddUserEvent
{
use SerializesModels;
@exileed
exileed / image.php
Created February 9, 2017 15:56
Image resize
<?php
$image = new class {
public width = null;
public height = null;
public function __construct($filename) {
list($width, $height) = getimagesize($filename);
$this->width = $width;
@exileed
exileed / select.sql
Created February 20, 2017 23:32
Select
select count( distinct user_id ) as n, d, dt from
(
select user_id,
z.zt as d,
G.dt
from
messages
cross join
( select distinct DATE_FORMAT( messages.date, '%Y-%m-%d') as zt from messages) z
inner join
@exileed
exileed / index.php
Last active March 20, 2017 20:07 — forked from anonymous/php
FuelingsController
<?php
namespace App\Http\Controllers\Vehicles;
use App\Helpers\CarbonFormatter;
use App\Http\Controllers\Controller;
use App\Models\Dictionaries\FuelType;
use App\Models\Vehicles\Fueling;
use App\Models\Vehicles\Car;
use Illuminate\Http\Request;
use Storage;
<?php
namespace App\Commands\Telegram\Bot;
use Telegram\Bot\Keyboard\Keyboard;
class PrivacyCommand extends AbstractCommand
{
<?php
namespace app\controllers;
use app\models\Login;
use app\models\Otchet;
use app\models\Result;
use app\models\Signup;
use Yii;
use yii\web\Controller;
@exileed
exileed / git-deployment.md
Created June 6, 2017 15:20 — forked from noelboss/git-deployment.md
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your lokal GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like my Deepl.io to act upon a Web-Hook that's triggered that service.

@exileed
exileed / router.php
Last active July 3, 2017 16:58
Notice: Undefined offset: 2 in /var/www/html/lib/router.php on line 44
<?php
##### ##### # # ##### ### ## # ##### ## ##
# # # # # # # # # # # # ## ##
##### # # # # # # # # # # ##
# # # # # # # # # # # # # # #
# # ##### ### # ### # ## ##### # #
# #
/** Router class by Mr CaT ) ) ) #########
@exileed
exileed / SoftDelete.php
Created August 8, 2017 21:36
Soft delete behavior for Yii2 ActiveRecord
<?php
namespace app\traits;
/**
* Soft delete behavior for Yii2 ActiveRecord
*
* @property-read bool $isDeleted
*/
trait SoftDelete