Skip to content

Instantly share code, notes, and snippets.

View novomirskoy's full-sized avatar

Endin Artyom novomirskoy

View GitHub Profile
@novomirskoy
novomirskoy / gist:11167501
Created April 22, 2014 06:39
Копирование коллекции из локальной базы в удаленную для Mongodb
use dbname
var db_remote = connect('xxx.xxx.xxx.xxx:27017/db_remote_name')
db.collection_name.find().forEach(function(doc) { db_remote.remote_collection_name(doc); });
@novomirskoy
novomirskoy / .tintrc
Created May 7, 2014 05:37
Tint2 config
#---------------------------------------------
# TINT2 CONFIG FILE
#---------------------------------------------
# For more information about tint2, see:
# http://code.google.com/p/tint2/wiki/Welcome
#
# For more config file examples, see:
# http://crunchbanglinux.org/forums/topic/3232/my-tint2-config/
# Background definitions
# conky configuration
#
# The list of variables has been removed from this file in favour
# of keeping the documentation more maintainable.
# Check http://conky.sf.net for an up-to-date-list.
#
# For ideas about how to modify conky, please see:
# http://crunchbanglinux.org/forums/topic/59/my-conky-config/
#
# For help with conky, please see:
--создаем последовательность для будущей таблицы area_type
CREATE SEQUENCE area_type_gid_seq
INCREMENT 1
MINVALUE 1
MAXVALUE 9223372036854775807
START 1
CACHE 1;
ALTER TABLE area_type_gid_seq
OWNER TO postgres;
SELECT
GROUP_CONCAT(DISTINCT rubric.name SEPARATOR ', ') as 'Рубрики',
CONCAT(object.legal_form, ' ',object.name, ' (' , object.legal_name,')') as 'Название компании (юр.лицо)',
GROUP_CONCAT(DISTINCT object.sphere SEPARATOR ', ') as 'Специализация (сфера деятельности)',
COUNT(object.id) as 'Количество точек',
GROUP_CONCAT(DISTINCT object.phone_numbers) as 'Телефоны',
GROUP_CONCAT(DISTINCT postgis.ppab_view.address SEPARATOR ', ') as 'Адреса салонов',
postgis.ppab_view.sublocalityname as 'Район присутствия',
object.email as email,
object.url as 'Веб сайт'
public function xml2array ($xmlObject, $out = [])
{
foreach ((array)$xmlObject as $index => $node)
$out[$index] = (is_object($node)) ? $this->xml2array($node) : $node;
return $out;
}
Проверка правильности конфигурационного файла и всех подключаемых файлов
nginx -t -c <path-to-nginx.conf>
@novomirskoy
novomirskoy / laravel.nginx.conf
Created January 25, 2015 11:16
nginx config for laravel
server {
listen 80
server_name laravel.local;
root /var/www/laravel/public/;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
@novomirskoy
novomirskoy / phpci.conf
Created June 24, 2015 15:36
nginx config for phpci
server {
listen 80;
server_name phpci.local;
root /path/to/phpci;
index index.php index.html index.htm;
location {
try_files $uri @phpci;
}
@novomirskoy
novomirskoy / flarum.conf
Created June 26, 2015 11:29
nginx config for flarum
server {
listen 80;
root /vagrant;
index index.html index.htm index.php app.php app_dev.php;
# Make site accessible from ...
server_name 192.168.29.29.xip.io flarum.dev;
access_log /var/log/nginx/vagrant.com-access.log;