This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
query{ | |
reference { | |
list(type: "color"){ | |
items{ | |
name | |
type | |
sort | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Backup | |
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
# Restore | |
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## Upgrade to php7.2 and install required dependencies | |
# execute this script using | |
# source <(curl RAW_GIST_URL) | |
read -p "You are about to upgrade to PHP 7.2 OK? " -n 1 -r | |
echo | |
if [[ $REPLY =~ ^[Yy]$ ]] | |
then | |
echo 'y' | sudo add-apt-repository ppa:ondrej/php && \ | |
sudo apt-get update && \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
in .htaccess | |
<IfModule mod_headers.c> | |
Header set Content-Security-Policy "default-src 'self' *.televizor-x.ru data: 'unsafe-inline' https://www.youtube.com https://yandex.ru https://mc.yandex.ru https://yastatic.net 'unsafe-eval'" | |
</IfModule> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function get_web_page( $url ){ | |
$options = array( | |
CURLOPT_RETURNTRANSFER => true, // return web page | |
CURLOPT_HEADER => false, // don't return headers | |
CURLOPT_FOLLOWLOCATION => true, // follow redirects | |
CURLOPT_ENCODING => "", // handle all encodings | |
CURLOPT_USERAGENT => "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17", // who am i | |
CURLOPT_AUTOREFERER => true, // set referer on redirect |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @package Joomla.Site | |
* @subpackage mod_breadcrumbs | |
* | |
* @copyright Copyright (C) 2005 - 2016 Open Source Matters, Inc. All rights reserved. | |
* @license GNU General Public License version 2 or later; see LICENSE.txt | |
*/ | |
defined('_JEXEC') or die; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Insert many rows as one query | |
* @param array $data Insert array(array('field_name' => 'field_value'), array('field_name' => 'field_value_new')) | |
* @return bool | |
*/ | |
public function multiInsert(array $data) | |
{ | |
$sqlStringTemplate = 'INSERT INTO %s (%s) VALUES %s'; | |
$adapter = $this->tableGateway->adapter; /* Get adapter from tableGateway */ | |
$driver = $adapter->getDriver(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/*************************************************** | |
* View Helper | |
**************************************************/ | |
$this->getRequest()->getPost('id', null); | |
$this->headScript()->appendFile('/static/js/parsley.js','text/javascript'); | |
$this->headLink()->appendStylesheet('/static/css/themenuebersicht.css'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$fooTable = new Application_Model_Useroptions; | |
$options = $fooTable->getUserOptions(); | |
$checkboxes = new Zend_Form_Element_MultiCheckbox('checkboxes'); | |
$checkboxes->setLabel('Options'); | |
$checkboxes->setRegisterInArrayValidator(false); | |
foreach ($options as $opt) | |
$checkboxes->addMultiOption($opt->id_option, $opt->title); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Клонируем исходный репозиторий без рабочего каталога (--bare) | |
git clone --bare https://github.com/exampleuser/old-repository.git | |
cd old-repository.git | |
# Делаем mirror-push(будут скопированы все ветки и тэги) в новый репозиторий | |
git push --mirror https://github.com/exampleuser/new-repository.git | |
cd .. | |
# Удаляем папку с репозиторием |