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 | |
//////////////////////////////////// Returns 0 records | |
$pdo = new \PDO('pgsql:host=localhost;dbname=postgres', 'postgres', 'postgres'); | |
$sql = <<<SQL | |
SELECT * | |
FROM ( | |
SELECT 'CHAC TECHNOLOG*' as alias |
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 | |
$pdo = new \PDO('pgsql:host=localhost;dbname=postgres', 'postgres', 'postgres'); | |
$sql = <<<SQL | |
SELECT * | |
FROM ( | |
SELECT 'CHAC TECHNOLOG*' as alias | |
UNION | |
SELECT 'KINDERY LIGHTING SALES DE?T*' |
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
---------------------------------------------------- | |
-- Проверим, как работают внешние ключи с партициями | |
---------------------------------------------------- | |
DROP TABLE IF EXISTS content_sentiments2016 CASCADE; | |
DROP TABLE IF EXISTS content_sentiments2018 CASCADE; | |
DROP TABLE IF EXISTS content_sentiments CASCADE; | |
DROP TABLE IF EXISTS content_keywords CASCADE; | |
DROP TABLE IF EXISTS content2016 CASCADE; | |
DROP TABLE IF EXISTS content2017 CASCADE; |
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
-- Создаем базы данных | |
CREATE DATABASE "sahrding-main" OWNER = dev; -- Основная | |
CREATE DATABASE "sahrding-part-2016" OWNER = dev; -- Шард 1 | |
CREATE DATABASE "sahrding-part-2017" OWNER = dev; -- Шард 2 | |
-- Следующие запросы выполняем для каждой базы данных sahrding-part-* | |
-- Создаем таблицы где будут храниться реальные данные. | |
-- Со всеми необходимыми индексами и ограничениями. | |
CREATE TABLE content ( | |
id int not null, |
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
# контекст, в котором указываются директивы виртуального сервера | |
server { | |
# порт на который сервер будет принимать запросы | |
listen 80; | |
# имена виртуального сервера | |
server_name myproject.lh; | |
# корневой каталог для запросов | |
root /var/www/myproject/public; |
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 | |
echo | |
echo '-- STOP --' | |
docker stop $(docker ps -a -q) | |
docker rm $(docker ps -a -q) | |
echo | |
echo '-- START --' |
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 | |
PREFIX=$(readlink -m $(dirname $0)) | |
if [[ ! $(command -v wget) && ! $(command -v curl) ]]; then | |
echo "You need either 'wget' or 'curl' programm to download necessary files" | |
exit 1 | |
fi | |
if [[ ! $(command -v perl) ]]; then | |
echo "You'll need some perl. Consider installing it." |
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
select * from ( | |
-- Основной запрос (начало) | |
select id, name from iris_account | |
where id != '0a80d5e5-97dc-c391-ed4f-2bc63c75ad38' | |
order by name desc -- сортировка таблицы для выборки данных на странице | |
-- конец | |
limit 3 | |
) t | |
union |
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
<HTML> | |
<?php | |
/** | |
* Шаблон страницы | |
*/ | |
?> | |
<head> | |
<title>Iris CRM</title> | |
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=<?php echo GetDefaultEncoding(); ?>"/> |
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
// Есть объект | |
var object = { | |
prop: 'object property', | |
method: function() { | |
console.log(this.prop); | |
} | |
} | |
// Так работает без ошибок | |
console.log("1:"); |