Skip to content

Instantly share code, notes, and snippets.

@pioh
pioh / getStats.js
Last active January 20, 2017 09:06
getStats
POST: /api/getStats?token=eyJhbGciO // Нужен POST а не GET потому что полигоны могут не влезть в ограничение GET на 3-4Kb.
REQUEST:
{
"filter": { // все поля которые есть в фильтре по запросу api/filterOffers
"price": {
"from": null,
"to": null
},
"trusted": null,
"separateEntrance": null,
@pioh
pioh / postgres.conf
Last active January 15, 2017 05:08
postgres.conf
listen_addresses = '*'
max_connections = 100 # (change requires restart)
shared_buffers = 50GB # min 128kB
work_mem = 512MB # min 64kB
maintenance_work_mem = 2GB # min 1MB
dynamic_shared_memory_type = posix # the default is the first option
effective_io_concurrency = 8 # 1-1000; 0 disables prefetching
max_worker_processes = 12 # (change requires restart)
wal_buffers = 16MB # min 32kB, -1 sets based on shared_buffers
max_wal_size = 4GB
@pioh
pioh / types.api.js
Created January 27, 2017 10:21
Baikal types api
// Для задачи WEB-2021 пока можно сделать только Sources.
// В дальнейшем если будут приходить другие типы я автоматически буду их использовать.
// Русский текст который сдесь так и будет вставляться напрямую в фильтры и везде где используется тип.
GET /api/types :
{
Sources : {
'cianCommercial' : 'ЦИАН',
'domofondCommercial' : 'Домофонд',
'arendator' : 'Арендатор'
},
@pioh
pioh / dictionary.toml
Last active February 7, 2017 16:04
Example structs
[FlowIntencity]
HIGH = 'Высокий трафик'
MODERATE = 'Низкий трафик'
LOW = 'Средний трафик'
[Flooring]
ASPHALT_OR_CONCRETE_TILE = 'Асфальт или бетонная плитка'
PLAIN_CONCRETE = 'Бетон без покрытия'
CONCRETE_WITH_ANTIDUST_COATING = 'Бетонный пол с антипылевым покрытием'
@pioh
pioh / GetFields.SQL
Last active May 18, 2017 19:25
GetFields
SELECT
u.id AS user_id,
u.email,
p.comment,
NULL AS first_name,
NULL AS middle_name,
NULL AS last_name,
NULL AS lang
FROM nirhub.user AS u
LEFT JOIN nirhub.person AS p
@pioh
pioh / size.bat
Last active May 19, 2017 00:54
vboxsizer
C:\Program Files\Oracle\VirtualBox\VBoxManage.exe clonehd "C:\Users\thepi\VirtualBox VMs\ubuntu-17.04\ubuntu-17.04-disk001.vmdk" "C:\Users\thepi\VirtualBox VMs\ubuntu-17.04\ubuntu-17.04-disk001.vdi" --format vdi
C:\Program Files\Oracle\VirtualBox\VBoxManage modifyhd "C:\Users\thepi\VirtualBox VMs\ubuntu-17.04\ubuntu-17.04-disk001.vdi" --resize 30000
C:\Program Files\Oracle\VirtualBox\VBoxManage.exe clonehd "C:\Users\thepi\VirtualBox VMs\ubuntu-17.04\ubuntu-17.04-disk001.vdi" "C:\Users\thepi\VirtualBox VMs\ubuntu-17.04\ubuntu-17.04-disk002.vmdk" --format vmdk
@pioh
pioh / TestData.js
Created September 6, 2017 11:49 — forked from lifeart/TestData.js
WebWorker JSON Parse - async json parsing
console.log('Starting...');
console.time('Buiding test Data');
const jsonData = { data: new Array(4300000) };
for (let i = 0; i < 1300000; i++) {
jsonData.data[i]=`el-${i}`;
}
const dataString = JSON.stringify(jsonData);
console.timeEnd('Buiding test Data');
@pioh
pioh / OrderFields.tsx
Created October 27, 2017 21:20
RenderPropsExample
import * as React from 'react'
import {observer} from 'mobx-react'
import {FormGroup, Col, Label} from 'reactstrap'
import {OrderProvider} from 'components/OrderProvider/OrderProvider'
import {Input} from 'components/Input/Input'
import {Select} from 'components/Select/Select'
import {FieldFormat, InputAddon} from 'const/ReportForm/Field'
import {YesNoTable} from './YesNoTable'
@pioh
pioh / Router.js
Created November 15, 2017 14:40
store router example
// containers/Router/Router.js
import React, {Component, PropTypes} from 'react'
import {autorun, runInAction} from 'mobx'
import {observer, inject} from 'mobx-react'
import {AllTasksContainer, TasksContainer, OffersContainer, TaskContainer} from 'containers/Telephonist'
import {BaseLayout, Login} from 'components'
import {Stats} from 'components/Telephonist'
import {Error404, Error403} from 'components/Errors'