Skip to content

Instantly share code, notes, and snippets.

@pioh
pioh / baikal.conf
Last active October 3, 2016 11:33
nginx
server {
listen *:80;
server_name baikal.srg-it.ru;
gzip on;
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript;
@pioh
pioh / temp.conf
Last active October 5, 2016 13:38
server {
listen *:80;
server_name baikal.srg-it.ru;
add_header Access-Control-Allow-Origin *;
if ($ssl_protocol = "") {
return 301 https://$host$request_uri;
}
access_log /var/log/nginx/baikal.srg-it.ru.access.log combined;
server {
listen *:80 http2;
server_name baikal.srg-it.ru;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript a
add_header Access-Control-Allow-Origin *;
if ($ssl_protocol = "") {
return 301 https://$host$request_uri;
}
index index.html;
@pioh
pioh / ph.js
Created October 11, 2016 18:38
jsWebProxy
"use strict";
var page = require('webpage').create(),
system = require('system'),
t, address, timeout, count, regexp, finish;
address = system.args[1];
timeout = +(system.args[2] || 10000)
count = system.args[3] || 1
regexp = new RegExp(system.args[4] || '.*', 'g')
finish = new Date().getTime()+ timeout;
@pioh
pioh / API
Last active October 17, 2016 16:57
// TODO Характеристики объекта. Линия домов – поле с возможностью выбора значений выпадающего списка
// TODO Дополнить типы ошибок
/*
enum - передаются в виде строки ("INTERNAL" для ErrorType::INTERNAL)
type - передаются в виде json
например для {user User, error Error} может быть передано:
{
"user" : {
type : "EXPERT"
@pioh
pioh / getAllMetro.js
Last active November 3, 2016 13:07
MetroApi
// Get all info about world metro stations
// cityID, lineID, stationID - all unique IDs in the world, no stations with the same id in different cities
{
cityByID: {
2334 : {
text: 'Москва',
ID : 2334,
},
2335 : {
text: 'Питер',
@pioh
pioh / filterOffers.js
Last active November 15, 2016 10:48
filterOffers
filterOffers: { // запрос
filter: {
price: {
from: 10,
to: 5000,
},
realtyType: ['office'],
// ...остальные поля которые уже есть
limit: 10, // вернуть первые 10 объектов
@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 / 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 / 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')
}
}