This file contains hidden or 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
CREATE EXTENSION plpython2u; | |
-- TODO: | |
-- 1) Кэш соединения с ZMQ | |
-- 2) Найти оптимальный способ сериализаци данных | |
-- 3) Рассмотреть вариант с LISTEN/NOTIFY и PGQ | |
CREATE OR REPLACE FUNCTION row_trigger() | |
RETURNS TRIGGER | |
AS $$ | |
import json, zmq |
This file contains hidden or 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 IPython import Magics, magics_class, line_magic | |
from django.db.models import get_model | |
@magics_class | |
class ModelSearchMagics(Magics): | |
@line_magic | |
def model(self, app_label, model_name): | |
model_class = get_model(app_label, model_name) | |
self.shell.user_ns[model_class.__name__] = model_class |
This file contains hidden or 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
''' | |
test.py look like this:: | |
msg = 'prompt' | |
for i in range(1, 4): | |
msg = input(msg * i + '\n') | |
''' | |
import sys | |
import asyncio |
This file contains hidden or 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 python3 | |
import re | |
def demixer(iid, p): | |
return ''.join(re.findall(r'[\da-f]+',p)[::iid%1or-1])[::3] | |
if __name__ == '__main__': | |
print(demixer(291703670, 'b538f45188e082b038dad37e22466097861cef6sd4ff355e16dd279e973ddb1esce7adad83bb220e081s06fac1187c06a42')) | |
~ |
This file contains hidden or 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
# coding: utf-8 | |
#------------------------------------------------------------------------------ | |
# Imports | |
#------------------------------------------------------------------------------ | |
# Stdlib | |
import os | |
import re | |
# 3rdparty |
NewerOlder