Skip to content

Instantly share code, notes, and snippets.

View hellysmile's full-sized avatar
🦆
working hard!

Victor Kovtun hellysmile

🦆
working hard!
View GitHub Profile
class OpensslAT10 < Formula
desc "SSL/TLS cryptography library"
homepage "https://openssl.org/"
url "https://ftp.openssl.org/source/old/1.0.2/openssl-1.0.2u.tar.gz"
mirror "https://www.mirrorservice.org/sites/ftp.openssl.org/source/old/1.0.2/openssl-1.0.2u.tar.gz"
sha256 "ecd0c6ffb493dd06707d38b14bb4d8c2288bb7033735606569d8f90f89669d16"
revision 1
version_scheme 1
keg_only :provided_by_macos,
@hellysmile
hellysmile / threading_local.py
Created September 22, 2018 07:48
threading_local.py
from concurrent.futures import ThreadPoolExecutor
from threading import local, get_ident
ctx = local()
ctx.counter = 0
def inc(_):
try:
ctx.counter += 1
@hellysmile
hellysmile / Nginx_1.11_Mainline_Cent_6_7_Static_OpenSSL_1.1.sh
Created May 17, 2017 08:31 — forked from kennwhite/Nginx_1.11_Mainline_Cent_6_7_Static_OpenSSL_1.1.sh
RPM build Nginx 1.11.x with ALPN on CentOS 6/7 using static OpenSSL 1.1 (v 1.02+ required for http/2 support in Chrome)
# Based on CentOS7 fork of @smartmadsoft: https://gist.github.com/moneytoo/ab3f34e4fddc2110675952f8280f49c5
# "6" for CentOS6 or Amazon Linux, "7" for CentOS7
CENTVER="6"
OPENSSL="openssl-1.1.0-pre5"
NGINX="nginx-1.11.0-1"
yum clean all
# Install epel packages (required for GeoIP-devel)
import asyncio
from functools import partial
async def foo():
pass
print(asyncio.iscoroutinefunction(foo))
bar = partial(foo)
class Leveldb < Formula
desc "Key-value storage library with ordered mapping"
homepage "https://github.com/google/leveldb/"
url "https://s3.eu-central-1.amazonaws.com/wb-rd/leveldb-1.19-macos1012fix.tar.gz"
sha256 "7a580e543a3b69efb4407619c48dbeac2043eccd385574f9de53f2dcfea65897"
option "with-test", "Verify the build with make check"
depends_on "gperftools"
depends_on "snappy"
require 'formula'
class Libev < Formula
homepage 'http://software.schmorp.de/pkg/libev.html'
url 'http://dist.schmorp.de/libev/Attic/libev-4.23.tar.gz'
sha256 'c7fe743e0c3b50dd34bf222ebdba4e8acac031d41ce174f17890f8f84eeddd7a'
def install
system "./configure", "--disable-dependency-tracking",
"--prefix=#{prefix}",
#!/usr/bin/env bash
log() { echo -e "\e[0;33m${1}\e[0m"; }
# Ask for the administrator password upfront.
sudo -v
log 'Empty the Trash on all mounted volumes and the main HDD...'
sudo rm -rfv /Volumes/*/.Trashes
sudo rm -rfv ~/.Trash
import uuid
from django.db import models
class UUIDField(
models.UUIDField
):
def __init__(self, *args, **kwargs):
self.version = kwargs.pop('version', 1)
def get_urls(self):
password_urlpatterns = patterns(
'',
url(
r'^(.+?)/password/$',
self.admin_site.admin_view(self.user_change_password)
)
)
base_urlpatterns = super(UserAdmin, self).get_urls()
#!/usr/bin/env python
import logging
import tornado.ioloop
import tornado.web
import tornado.options
import tornado.httpclient
class Manager(object):