Skip to content

Instantly share code, notes, and snippets.

View onahirniak's full-sized avatar
💻
Continuously learning

Oleksandr Nahirniak onahirniak

💻
Continuously learning
View GitHub Profile
@onahirniak
onahirniak / pow.py
Created January 13, 2019 13:55 — forked from svdamani/pow.py
Fast Power calculation in Python
def power(base, exp):
""" Fast power calculation using repeated squaring """
if exp < 0:
return 1 / power(base, -exp)
ans = 1
while exp:
if exp & 1:
ans *= base
exp >>= 1
base *= base
@onahirniak
onahirniak / rabbitmq.txt
Created June 19, 2017 09:32 — forked from sdieunidou/rabbitmq.txt
create admin user on rabbitmq
rabbitmqctl add_user test test
rabbitmqctl set_user_tags test administrator
rabbitmqctl set_permissions -p / test ".*" ".*" ".*"