Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / types.api.js
Created January 27, 2017 10:21
Baikal types api
// Для задачи WEB-2021 пока можно сделать только Sources.
// В дальнейшем если будут приходить другие типы я автоматически буду их использовать.
// Русский текст который сдесь так и будет вставляться напрямую в фильтры и везде где используется тип.
GET /api/types :
{
Sources : {
'cianCommercial' : 'ЦИАН',
'domofondCommercial' : 'Домофонд',
'arendator' : 'Арендатор'
},
@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 / 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 / build.gradle
Created December 15, 2016 18:28
9r-web
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.3.5.RELEASE")
classpath('com.bmuschko:gradle-cargo-plugin:2.0.3')
classpath('org.flywaydb:flyway-core:4.0')
}
}
@pioh
pioh / TaskStoreApi.js
Created December 5, 2016 12:26
TaskStore
import TaskStore from './TaskStore'
function TaskStoreSaveErrors (data) {
let task = TaskStore(data)
return task.saveErrors
}
// task.saveErrors Example
// [
@pioh
pioh / test.srg-it.ru.conf
Last active November 22, 2016 12:06
test.srg-it.ru.conf
server {
listen *:80;
server_name test.srg-it.ru;
rewrite ^/?$ /ExpressSite/;
if ($ssl_protocol = "") {
return 301 https://$host$request_uri;
}
index index.html index.htm index.php;
@pioh
pioh / filterOffers.js
Last active November 15, 2016 10:48
filterOffers
filterOffers: { // запрос
filter: {
price: {
from: 10,
to: 5000,
},
realtyType: ['office'],
// ...остальные поля которые уже есть
limit: 10, // вернуть первые 10 объектов