This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from concurrent.futures import ThreadPoolExecutor | |
from threading import local, get_ident | |
ctx = local() | |
ctx.counter = 0 | |
def inc(_): | |
try: | |
ctx.counter += 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
from functools import partial | |
async def foo(): | |
pass | |
print(asyncio.iscoroutinefunction(foo)) | |
bar = partial(foo) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import uuid | |
from django.db import models | |
class UUIDField( | |
models.UUIDField | |
): | |
def __init__(self, *args, **kwargs): | |
self.version = kwargs.pop('version', 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import logging | |
import tornado.ioloop | |
import tornado.web | |
import tornado.options | |
import tornado.httpclient | |
class Manager(object): |
NewerOlder