Skip to content

Instantly share code, notes, and snippets.

View dmytrostriletskyi's full-sized avatar

Dmytro Striletskyi dmytrostriletskyi

View GitHub Profile
# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have user name fields,
# that none of the other crontabs do.
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# m h dom mon dow user command
user www-data;
worker_processes auto;
pid /run/nginx.pid;
events {
worker_connections 768;
}
http {
map $http_upgrade $connection_upgrade {
user www-data;
worker_processes auto;
pid /run/nginx.pid;
events {
worker_connections 768;
}
http {
map $http_upgrade $connection_upgrade {
tcp://node-1-testnet.remme.io:8800
tcp://node-5-testnet.remme.io:8800
tcp://node-10-testnet.remme.io:8800
tcp://node-15-testnet.remme.io:8800
tcp://node-20-testnet.remme.io:8800
tcp://node-25-testnet.remme.io:8800
tcp://node-29-testnet.remme.io:8800
user www-data;
worker_processes auto;
pid /run/nginx.pid;
events {
worker_connections 768;
}
http {
map $http_upgrade $connection_upgrade {
@dmytrostriletskyi
dmytrostriletskyi / python_access_modifiers_agreement_in_use.py
Last active April 12, 2019 19:16
Python access modifiers agreement in use.
class Car:
def _start_engine(self):
return "Engine's sound."
def run(self):
return self._start_engine()
if __name__ == '__main__':
from accessify import protected
class Car:
@protected
def start_engine(self):
return "Engine's sound."
def run(self):
Traceback (most recent call last):
File "examples/access/private.py", line 24, in <module>
car.start_engine()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/accessify/main.py", line 92, in private_wrapper
class_name=instance_class.__name__, method_name=method.__name__,
accessify.errors.InaccessibleDueToItsProtectionLevelException: Car.start_engine() is
inaccessible due to its protection level
class User:
def __init__(self, storage):
self.storage = storage
def create(self, name):
return storage.create_with_name(name=name)
class DatabaseStorage:
def create_with_name(self, name):
...