Skip to content

Instantly share code, notes, and snippets.

Andrey Fedorov anfedorov

Block or report user

Report or block anfedorov

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
anfedorov /
Last active Nov 3, 2019
Use multiprocessing's primitives to process events while also extending the Queue
from time import sleep
from multiprocessing import Queue, JoinableQueue, Process
class PoolQueue(object):
def __init__(self, n):
self.num_procs = n
self.procs = []
self.payloads = JoinableQueue()
self.results = Queue()
View sshd_config
# $OpenBSD: sshd_config,v 1.101 2017/03/14 07:19:07 djm Exp $
# This is the sshd server system-wide configuration file. See
# sshd_config(5) for more information.
# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin
# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. Uncommented options override the
View -
import numpy as np
import struct
def read(f, s, offset=0):
return struct.unpack(f, s[offset:offset+struct.calcsize(f)])
def read_files(imgf, labelf):
def check_group(S, O, check_abelian=False):
"""Checks group properties on set S and operation O.
S (set): elements of this group
O (callable): operation on two elements of S, returns an element of S
check_abelian (bool): check if this is an abelian group
# check that S is closed under O
"""Prisoners in hats problem
N prisoners are notified that they will be playing a game tomorrow morning.
First they will stand in a circle and close their eyes.
Hats of one of N colors will be put on their heads (hat colors may repeat).
They will open their eyes and see the colors of everyone else's hat.
They will close their eyes and simultaneously guess what their own hat color is.
If any one of them guesses correctly, they all go free.
Otherwise they all die.
View AddTrust External CA Root
Version: 3 (0x2)
Serial Number: 1 (0x1)
Signature Algorithm: sha1WithRSAEncryption
Issuer: C=SE, O=AddTrust AB, OU=AddTrust External TTP Network, CN=AddTrust External CA Root
Not Before: May 30 10:48:38 2000 GMT
Not After : May 30 10:48:38 2020 GMT
Subject: C=SE, O=AddTrust AB, OU=AddTrust External TTP Network, CN=AddTrust External CA Root

Keybase proof

I hereby claim:

  • I am anfedorov on github.
  • I am anfedorov ( on keybase.
  • I have a public key whose fingerprint is 51D5 B1BD A66B 2146 716F CBC3 63C0 13D2 659D A87E

To claim this, I am signing this object:

View designer.html
<link rel="import" href="../ace-element/ace-element.html">
<link rel="import" href="../chart-js/chart-js.html">
<link rel="import" href="../core-menu-button/core-menu-button.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-animated-pages/core-animated-pages.html">
<link rel="import" href="../core-animated-pages/transitions/hero-transition.html">
<link rel="import" href="../core-animated-pages/transitions/cross-fade.html">
<link rel="import" href="../core-animated-pages/transitions/slide-down.html">
<link rel="import" href="../core-animated-pages/transitions/slide-up.html">
anfedorov / echoHttpRequest.js
Last active Aug 29, 2015 — forked from Marak/echoHttpRequest.js
Echo HTTP requests
View echoHttpRequest.js
module['exports'] = function echoHttp (hook) {
hook.debug("Debug messages are sent to the debug console");
import re
from collections import namedtuple
from decimal import Decimal
from dateutil import parser
from functools import partial
token_parsers = {
'decimal': Decimal,
'payee': str,
You can’t perform that action at this time.