Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
connected=$(xrandr | grep 'HDMI-2 connected')
# подключен ли монитор
if [[ -z "$connected" ]]; then
echo 'Монитор не подключен'
# выключим отображение, если вдруг оно активно (просто был выдернут шнур)
xrandr --output HDMI-2 --off
@igancev
igancev / deployer-laradock-yii2.php
Last active January 7, 2018 08:29
Deployer + laradock + yii2 deploy production
<?php
namespace Deployer;
require 'recipe/yii2-app-advanced.php';
set('ssh_multiplexing', true);
set('bin/php', 'php');
set('repository', 'https://bitbucket.org/*****/*****');
set('git_tty', true);
@igancev
igancev / deployer.php
Created December 21, 2017 09:34
deployer-yii2-advanced
<?php
namespace Deployer;
require 'recipe/yii2-app-advanced.php';
/*
* Configuration
*/
set('bin/php', '/opt/php70/bin/php');
<?php
/**
* Хэлпер для простого рендера шаблонов
*
* Class Templater
* @author igancev
* @email [email protected]
*/
class Templater
{
@igancev
igancev / docker
Created April 15, 2017 16:15
docker
docker-compose.yml
---------------------------------------------
version: "2"
services:
nginx-frontend:
image: nginx
links:
- php-fpm
volumes:
@igancev
igancev / XmlHelper.php
Last active November 25, 2016 10:05
Подготовка текста перед вставкой его в xml (text2xml)
<?php
class XmlHelper
{
public static function text2xml($text)
{
$text = preg_replace("/[\x1-\x8\xB-\xC\xE-\x1F]/", "", $text);
$text = str_replace('"', '&quot;', $text);
$text = str_replace("&", "&amp;", $text);