Skip to content

Instantly share code, notes, and snippets.

import { createStore, createEffect } from 'effector';
import { listApi } from '../../api/Todo';
const listStore = createStore([]);
const stateStore = createStore('INIT');
const loadTodoList = createEffect(() => listApi());
stateStore.on(loadTodoList, () => 'LOADING');
@vlas-ilya
vlas-ilya / getAllIpAddresses.js
Created June 29, 2020 17:26
Get ips by mask
const int2ip = (ipInt) => (
(ipInt >>> 24) + '.' +
(ipInt >> 16 & 255) + '.' +
(ipInt >> 8 & 255) + '.' +
(ipInt & 255)
);
const ip2int = (ip) => ip.split('.').reduce(
(ipInt, octet) => (ipInt << 8) + parseInt(octet, 10), 0
) >>> 0;
import React, { Component } from 'react'
import { connect } from 'react-redux'
@connect(
state => ({
user: state.home.authentication.user
})
)
export default class Authorized extends Component {
constructor(props, context) {
@vlas-ilya
vlas-ilya / is_outlier.py
Created September 6, 2016 17:16
Группировка по факторным переменным и нахождение выбросов в каждой группе
is_outlier = lambda group: (np.abs(group - group.mean()) > 2 * group.std()).astype(int)
factors = df.select_dtypes(exclude=[np.number]).columns.tolist()
df['is_outlier'] = df.groupby(factors).transform(is_outlier)
"use strict";
function _toConsumableArray(arr) {
if (Array.isArray(arr)) {
for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) {
arr2[i] = arr[i];
}
return arr2;
} else {
return Array.from(arr);
"use strict";
var currying = function currying(fn) {
var fun = function fun() {
for (var _len = arguments.length, orig = Array(_len), _key = 0; _key < _len; _key++) {
orig[_key] = arguments[_key];
}
var inner = function inner() {
for (var _len2 = arguments.length, val = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
#!/usr/bin/env python
import random
multipliers=[2, 4, 10, 3, 5, 9, 4, 6, 8]
N10=0
result=""
random.seed()
for i in range(0, 9):
N = random.randint(0, 9)
@vlas-ilya
vlas-ilya / generate.py
Created April 15, 2016 18:20
sudo ln -s "/path/to/generate.py" /bin/generate
#!/usr/bin/python
import argparse
import requests
def send_request(params):
r = requests.post('http://online-generators.ru/ajax.php', data=params)
return r.text
group 'test.thrift'
version '1.0-SNAPSHOT'
apply plugin: 'java'
allprojects {
apply plugin: "idea"
}
sourceCompatibility = 1.5
#!/usr/bin/env python
import random
multipliers=[2, 4, 10, 3, 5, 9, 4, 6, 8]
N10=0
result=""
random.seed()
for i in range(0, 9):
N = random.randint(0, 9)