Skip to content

Instantly share code, notes, and snippets.

View hgenru's full-sized avatar

Alexander Plesovskikh hgenru

View GitHub Profile
@hgenru
hgenru / filepond.d.ts
Created November 26, 2018 11:12
FilePond typing draft
declare module 'filepond' {
type Func = (...args: any[]) => any
type Source = string | File | Blob
type Headers = {[header: string]: string}
type Process = (
isFinite: boolean,
loaded: number,
@hgenru
hgenru / TASK_TO_COMMIT_MESSAGE.md
Last active November 9, 2016 13:14
Add task number to all commit in task branch
{
"env": {
"node": true,
"mocha": true,
"es6": true
},
extends: "google",
"rules": {
"camelcase": "off",
"indent": ["error", 4, {"SwitchCase": 1}],
import React from 'react';
import {connect} from 'react-redux';
import {Link} from 'react-router';
import {fetchCurrentUser} from '../../common/ducks/index';
function stateToProps(state) {
return {
user: state.$user
};
@hgenru
hgenru / parser.py
Last active August 29, 2015 14:12
Кладбищепарсер
import math
import json
from glob import glob
from lxml import etree
import geopy
from geopy.distance import VincentyDistance
def calculate_initial_compass_bearing(pointA, pointB):
@hgenru
hgenru / hello.py
Last active April 5, 2017 10:15
Tornado testing 4.0.1 WTF
from tornado.web import RequestHandler
class HelloHandler(RequestHandler):
def get(self):
self.write('Hello world!')
@hgenru
hgenru / rpn.py
Last active August 29, 2015 14:02
Reverse Polish Notation (python)
OPERATORS = {
'*': lambda a, b: a * b,
'/': lambda a, b: a / b,
'+': lambda a, b: a + b,
'-': lambda a, b: a - b
}
def polish_eval(exp):
exp_list = exp.split(' ')
# -*- python -*-
# encoding: utf-8
# ex: set syntax=python:
from libs import project
from os.path import expanduser
from buildbot.buildslave import BuildSlave
from buildbot.changes.filter import ChangeFilter
from buildbot.config import BuilderConfig
from buildbot.process.factory import BuildFactory
from buildbot.schedulers.basic import SingleBranchScheduler