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
{ | |
"event": "message", | |
"session": "default", | |
"me": { | |
"id": "[email protected]", | |
"pushName": "Smartdiag" | |
}, | |
"payload": { | |
"id": "[email protected]_244D2FFE3C40ACA6B77F5A56EDC457B9", | |
"timestamp": 1706083237, |
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
# run in "root" folder (e.g /home/datmusic/api.datmusic.xyz/) | |
chown -R kostya:www-data storage .env | |
find storage -type f -exec chmod 664 {} \; | |
find storage -type d -exec chmod 775 {} \; | |
chgrp -R www-data storage .env | |
chmod -R ug+rwx storage .env |
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 choose_payment_method_keyboard(uid, premium_type, lang): | |
"""Клавиатура для выбора способа оплаты. | |
:param premium_type: срок оплаты подписки | |
""" | |
data = { | |
'receiver': 410013085383235, | |
'successURL': 'https://telegram.me/pstrbot', | |
'formcomment': 'PosterBot', | |
'short-dest': 'PosterBot Premium ({n} {m})'.format( | |
n=config.PREMIUM_TYPES[premium_type]['months'], |
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 telebot | |
bot = telebot.TeleBot('TOKEN') | |
@bot.message_handler(commands=['start']) | |
def start(m): | |
msg = bot.send_message(m.chat.id, 'Как тебя зовут?') # сохраняем данные сообщения в msg | |
bot.register_next_step_handler(msg, hello) # переводим пользователя в функцию hello | |
def hello(m): |
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 telebot | |
from telebot import types | |
TOKEN = '' | |
bot = telebot.TeleBot(TOKEN) | |
with open('./SH.txt', 'r') as file: | |
BOOK = file.read() # открываем книгу и записываем её в BOOK | |
def pages_keyboard(start, stop): |
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
// Matrix Line.cpp : Defines the entry point for the console application. | |
// | |
#include "stdafx.h" | |
#include <iostream> | |
#include <ctime> | |
#include <Windows.h> | |
using namespace std; | |
int _tmain(int argc, _TCHAR* argv[]) |
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
#include <iostream> | |
#include <ctime> | |
using namespace std; | |
int main(int argc, char const *argv[]) { | |
srand(time(0)); | |
int n, m; | |
cout << "Input n (str num) and m (col num): "; | |
cin >> n; |
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
<!-- Меню в Anchor --> | |
<?php if(has_menu_items()): /*проверяет, если пункты меню*/ ?> | |
<ul> | |
<?php while(menu_items()): /*выводит один пункт меню (ссылку)*/ ?> | |
<li <?php echo (menu_active() ? 'class="active"' : ''); /*если ссылка активна, добавляется class="active"*/ ?>> | |
<a href="<?php echo menu_url(); /*url адрес*/ ?>" title="<?php echo menu_title(); /*заголовок*/ ?>"> | |
<?php echo menu_name(); /*название*/ ?> | |
</a> | |
</li> |
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
<?php | |
// В файле anchor/libraries/anchor.php меняем строки 50 - 65 с: | |
public static function functions() { | |
if( ! is_admin()) { | |
$fi = new FilesystemIterator(APP . 'functions', FilesystemIterator::SKIP_DOTS); | |
foreach($fi as $file) { | |
if($file->isFile() and $file->isReadable() and '.' . $file->getExtension() == EXT) { |
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
<?php $years = array(); $months = array(); ?> | |
<?php if(has_posts()): while(posts()): ?> | |
<?php $y = date('Y', article_time()); $m = date('F', article_time()); ?> | |
<?php if( ! in_array($y, $years)): $years[] = $y; ?> | |
<h1><?php echo $y; ?></h1> | |
<?php endif; ?> |