Skip to content

Instantly share code, notes, and snippets.

View matperez's full-sized avatar

Andrey Golovin matperez

  • Chelyabinsk, Russia
View GitHub Profile
@matperez
matperez / 1632823990.json
Last active May 9, 2024 13:18
Karabiner elements Russian layout
{
"title": "For Russian",
"rules": [
{
"description": "Заменить / в русской раскладке на точку",
"manipulators": [
{
"conditions": [
{
"type": "input_source_if",
@matperez
matperez / commands\MigrateController.php
Created February 1, 2016 18:36
yii2 massive migrations
<?php
namespace app\commands;
use app\interfaces\IMigrationAware;
use Yii;
use yii\base\Module;
use yii\console\Exception;
/**
* MigrateController
@matperez
matperez / PageController.php
Last active September 24, 2015 12:23
Yii2 localized page urls.
<?php
namespace app\modules\page\controllers;
use app\components\web\Controller;
use app\modules\page\models\PageLangQuery;
use app\modules\page\models\PageQuery;
use yii\base\InvalidParamException;
use yii\web\NotFoundHttpException;
use yii\web\Request;
@matperez
matperez / DefaultController.php
Last active October 22, 2021 20:20
Render twig templates from string
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
namespace app\commands;
use app\components\twig\TwigRenderer;
@matperez
matperez / phantomjs
Last active August 29, 2015 14:28 — forked from deviantony/phantomjs
Installer script to setup phantomjs 1.9.8, it will remove any previous setup. Contains also the init script to manage phantomjs as a system service and the default configuration file. Tested on Ubuntu 12.04.
#! /bin/sh
# Init. script for phantomjs, based on Ubuntu 12.04 skeleton.
# Author: Anthony Lapenna <lapenna.anthony@gmail.com>
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="Phantomjs service"
NAME=phantomjs
DAEMON=/usr/bin/$NAME
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME