Skip to content

Instantly share code, notes, and snippets.

@pioh
pioh / Dockerfile
Created April 13, 2018 09:29
dante socks5 proxy
FROM wernight/dante
# TODO: Replace 'john' and 'MyPassword' by any username/password you want.
RUN printf 'proxypassword123\nproxypassword123\n' | adduser proxyuser321
@pioh
pioh / core.scss
Last active February 22, 2018 23:32
webpack scss config
@import '~react-select/dist/react-select.css';
* {
padding: 0;
margin: 0;
box-sizing: border-box;
}
html {
font-size: 13px;
@pioh
pioh / skbn.cpp
Created February 9, 2018 21:40
skbn
#pragma comment(linker, "/STACK:134217728")
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
using std::cin;
using std::cout;
int m, n, sz, num, numb;
@pioh
pioh / README.md
Last active December 6, 2017 11:03
MergeContext
  • Сделать updateContext и replaceOffer с мержем только по переданным объектам
    • переписывать только по переданным путям в map
    • перезаписывать полностью с нуля переданный array
    • игорировать undefined поля и не игнорировать а перезаписывать null поля
  • Добавить лок всех операций над контекстом на уровне reportID (id контекста)
  • Отдельно кастомизировать мерж массива corrections в виде corrections: [{hid: "hid123", a: {b: {c: 'value'}}]
  • Добавить поле comparableHID
  • Добавить поле filter
  • Добавить поле registryBackUrl
  • Добавить поле версии в context и в offer
@pioh
pioh / table.js
Created November 29, 2017 01:28
table ex
const tableModel = {
@observable data = []
@observable sort = null
@observable dir = null
@observable page = 1
@observable totalEntities = 0
@observable entitiesOnPage = 10
@computed get sortedData () {
return this.data.sort((a, b))
@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'
@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 / 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 / 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