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
package main | |
import ( | |
"fmt" | |
"io/ioutil" | |
"log" | |
"net/http" | |
"sync" | |
) |
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
apiVersion: v1 | |
kind: Secret | |
metadata: | |
name: akhq-secrets | |
labels: | |
app.kubernetes.io/name: akhq | |
type: Opaque | |
stringData: | |
application-secrets.yml: | | |
akhq: |
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 asyncpg | |
import ujson | |
class Transaction: | |
def __init__(self, pool): | |
self.pool = pool | |
async def __aenter__(self): | |
self.acquire_context = self.pool.acquire() |
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 psycopg2 | |
import json | |
class Database: | |
@staticmethod | |
def insert(data): | |
insert_data = '' | |
insert_data_row = [] | |
field_order = tuple({key for request in data for key in request.keys()}) |
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 parsing_data(): | |
for i in main.urls: | |
data, data2 = [], [] | |
r = requests.get(i, headers=main.headers) | |
text = r.text | |
doc = fromstring(text) | |
block = doc.cssselect("#tabs-last-pos > div > div > div.table-cell.cell-full.collapse-768")[0] |
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 forward_messages(bot, update): | |
upd = update.to_dict() | |
"""MASS SAVING""" | |
chatid = upd['message']['chat']['id'] | |
msg = upd['message']['text'] | |
if msg == '/cleardb': | |
pass | |
elif msg == '/done': |
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 show_q(bot, update): | |
x = update.message.text.split(' ') | |
print(x) | |
if len(x) <= 1 or len(x) > 3: | |
print('FALSE') | |
else: | |
if x[0] == '!!qq': | |
try: | |
k = int(x[1]) | |
except (ValueError, IndexError): |