Skip to content

Instantly share code, notes, and snippets.

View pvpshoot's full-sized avatar
🍎

Mike Sinyakov pvpshoot

🍎
  • Rostelecom IT
  • Ulyanovsk
View GitHub Profile
file = File.open("input");
lines = file.readlines
arr = []
subA = []
i = 0
for line in lines do
i += 1
n = line.to_i
if n > 0
import { types } from 'mobx-state-tree';
const StatusModel = types
.model('StatusModel', {
statusValue: types.optional(types.enumeration('status', ['initial', 'loading', 'success', 'failed']), 'initial'),
statusResponseReasonMessage: types.maybe(types.string),
})
.views(self => ({
get isInitial() {
return self.statusValue === 'initial';
@pvpshoot
pvpshoot / contacts
Last active October 10, 2019 11:28
github - https://github.com/pvpshoot
vk - http://vkontakte.ru/pvpshoot
tw - https://twitter.com/pvpshoot
telegram - @pvpshoot
const COLORS = {
blue: ['#1E88E5', '#90CAF9'],
brown: ['#6D4C41', '#D7CCC8'],
gray: ['#212121', '#BDBDBD'],
green: ['#388E3C', '#A5D6A7'],
red: ['#E53935', '#EF9A9A'],
orange: ['#F4511E', '#FFAB91'],
purple: ['#8E24AA', '#E1BEE7'],
yellow: ['#FFD600', '#FFF59D'],
}
@pvpshoot
pvpshoot / index.js
Last active June 1, 2018 13:32
RFR help
import {
applyMiddleware,
combineReducers,
compose,
createStore as createReduxStore,
} from 'redux';
import { connectRoutes } from 'redux-first-router';
import thunk from 'redux-thunk';
import createHistory from 'history/createBrowserHistory';
@pvpshoot
pvpshoot / cloudSettings
Last active November 22, 2021 18:58
Visual Studio Code Settings Sync Gist
{"lastUpload":"2018-03-10T09:18:02.381Z","extensionVersion":"v2.9.0"}
@pvpshoot
pvpshoot / trace.js
Last active April 21, 2017 11:09
Debug fucntion for compose
const trace = tag => x => {
console.log(tag, x);
return x;
};
@pvpshoot
pvpshoot / Pattern matching
Created March 20, 2017 07:45
fp-switch, pattern matching
const patternMatch = (o, cond, or) => {
if (typeof o[cond] !== 'function') {
return or || null;
}
return o[cond]();
}
const TEST = {
lol(){ return: 'lol' },
This file has been truncated, but you can view the full file.
/******/ (function(modules) { // webpackBootstrap
/******/ var parentHotUpdateCallback = this["webpackHotUpdate"];
/******/ this["webpackHotUpdate"] =
/******/ function webpackHotUpdateCallback(chunkId, moreModules) { // eslint-disable-line no-unused-vars
/******/ hotAddUpdateChunk(chunkId, moreModules);
/******/ if(parentHotUpdateCallback) parentHotUpdateCallback(chunkId, moreModules);
/******/ }
/******/
/******/ function hotDownloadUpdateChunk(chunkId) { // eslint-disable-line no-unused-vars
/******/ var head = document.getElementsByTagName("head")[0];
class Maybe{
constructor(val){
this._value = val;
}
static of = x => new Maybe(x);
isNothing = () => (this.__value === null || this.__value === undefined);
map = () => this.isNothing() ? Maybe.of(null) : Maybe.of(f(this.__value));