Skip to content

Instantly share code, notes, and snippets.

View smgladkovskiy's full-sized avatar
💻
Senior Refactoring Engineer

Sergey Gladkovskiy smgladkovskiy

💻
Senior Refactoring Engineer
View GitHub Profile
@smgladkovskiy
smgladkovskiy / pre-commit
Created May 30, 2019 20:06
Pre-commit git hook to update TravisCI and CodeCov badges URL to aim current branch
#!/usr/bin/python2
"""
Referencing current branch in github README.md
This pre-commit hook updates the README.md file's
Travis and CodeCov badges with the current branch.
"""
import subprocess
# Hard-Coded for your repo (ToDo: get from remote?)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://schema.tmc24.io/accounting/ticket_process/request.schema.json",
"type": "object",
"title": "Запрос на передачу данных по оказанной услуге для формирования счёта",
"definitions": {
"service_alias": {
"type": "string",
"title": "Алиас сервиса",
"enum": ["avia", "railway", "aeroexpress", "hotel"]
@smgladkovskiy
smgladkovskiy / RelationOrderScopeTrait.php
Last active August 29, 2015 14:08
Laravel 4 Relation table column orderBy scope
<?php namespace Site\Traits;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasOne;
use Illuminate\Database\Eloquent\Builder;
trait RelationOrderScopeTrait {
/**
* Order also and by related table column
@smgladkovskiy
smgladkovskiy / BaseController.php
Created November 7, 2014 07:51
Laravel 4 Ajax Base Controller
<?php namespace Ajax;
use Controller;
use Illuminate\Http\Response;
use Illuminate\Pagination\Paginator;
use Illuminate\Support\MessageBag;
use Laracasts\Commander\CommanderTrait;
use Response as RequestResponse;
class BaseController extends Controller {
@smgladkovskiy
smgladkovskiy / Mailer.php
Created September 3, 2014 08:59
Laravel 4 custom Mailer class to queue mail with i18n content
<?php namespace Site\Mailers;
use Closure;
use Exception;
use I18n;
use Illuminate\Mail\Mailer as Mail;
use Illuminate\Mail\Message;
use Illuminate\Queue\QueueManager;
use Illuminate\Support\SerializableClosure;
use Site\Exceptions\SentMailException;
@smgladkovskiy
smgladkovskiy / README.md
Last active December 26, 2015 16:59
Shell script to capitalise files and directories in git repo in case insensitive OS (i.e. Windows)

Скачивание/обновление файла git_capitalize.sh:

$ curl -o git_capitalize.sh https://gist.githubusercontent.com/smgladkovskiy/7184020/raw/git_capitalize.sh
@smgladkovskiy
smgladkovskiy / site.php
Last active December 20, 2015 22:29
Site config for Kohana v3.3 site
<?php defined('SYSPATH') OR die('No direct access allowed.');
$version = 'wip';
$version_config = Kohana::$config->load('version');
if($version_config->as_array())
{
$version = $version_config->version;
}
return array(
@smgladkovskiy
smgladkovskiy / README.md
Last active August 22, 2023 21:54
Скрипты развёртывания продакшен, дев и тестовой сред на сервере.

Скачивание/обновление файла deploy.sh:

$ curl -o deploy.sh https://gist.githubusercontent.com/smgladkovskiy/6133041/raw/deploy.sh

Скачивание файла project.sh:

$ curl -o project.sh https://gist.githubusercontent.com/smgladkovskiy/6133041/raw/project.sh

Скачивание файла доп комманд extra_commands.sh:

@smgladkovskiy
smgladkovskiy / README.md
Last active October 4, 2015 13:27
Kohana 3.3 project creation script

Run this in your command line to make the process begin:

$ curl -o ko3.3_structure.sh https://raw.github.com/gist/2643818/ko3.3_structure.sh &amp;&amp; ./ko3.3_structure.sh
@smgladkovskiy
smgladkovskiy / README
Created January 30, 2012 04:33
Kohana 3.2 project creation script
Run this in your command line to make the process begin:
$ curl -o ko3_structure.sh https://raw.github.com/gist/1702555/ko3_structure.sh && ./ko3_structure.sh