Skip to content

Instantly share code, notes, and snippets.

View Zuckonit's full-sized avatar
:octocat:
I may be slow to respond.

Mocker Zuckonit

:octocat:
I may be slow to respond.
View GitHub Profile
@jonhoo
jonhoo / README.md
Last active July 19, 2021 10:49
Distributed RWMutex in Go
@mengzhuo
mengzhuo / boyer_moore
Created March 6, 2015 16:05
Boyer Moore Demo in Python
#!/usr/bin/env python
# encoding: utf-8
"""
Boyer Moore Demo
Inspired by https://www.youtube.com/watch?v=PHXAOKQk2dw
Copyright (C) 2015 Meng Zhuo <[email protected]>
"""
def make_bad_match_table(pattern):
@dawn110110
dawn110110 / pyftp.py
Created December 30, 2013 16:12
pyftpdlib. server in one file.
#!/usr/bin/env python
# ftpserver.py
#
# pyftpdlib is released under the MIT license, reproduced below:
# ======================================================================
# Copyright (C) 2007 Giampaolo Rodola' <[email protected]>
#
# All Rights Reserved
#
# Permission to use, copy, modify, and distribute this software and
@ionelmc
ionelmc / client_with_retry.py
Last active December 14, 2015 09:18
__retry decorator
class ApiClient(object):
default_retries = (1, 2, 5, 10, 20, 30)
def __retry(func):
@wraps(func)
def wrapper(self, *args, **kwargs):
retries = kwargs.pop('retries', self.default_retries)
try:
if kwargs.pop('reconnect', False):
self.__init__(self.ftp_uri, retries=())
@ewindisch
ewindisch / log.py
Created January 8, 2013 21:43
openstack common (oslo) log.py
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack LLC.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at