Skip to content

Instantly share code, notes, and snippets.

View novomirskoy's full-sized avatar

Endin Artyom novomirskoy

View GitHub Profile
public function xml2array ($xmlObject, $out = [])
{
foreach ((array)$xmlObject as $index => $node)
$out[$index] = (is_object($node)) ? $this->xml2array($node) : $node;
return $out;
}
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 'Веб сайт'
--создаем последовательность для будущей таблицы 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;
# 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:
@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
@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); });