app/
- head.tsx
- layout.tsx
- page.tsx
- blog/[slug]/page.tsx
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 bash | |
| set -e | |
| ### === НАСТРОЙКИ === | |
| SWAP_SIZE_GB=4 # размер swap в ГБ | |
| SWAP_FILE="/swapfile" | |
| SWAPPINESS=10 # 0–100 | |
| ### ================= |
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
| <?php | |
| $bot_token = '0123456789:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'; | |
| $data_check_string = 'XXX'; // get from Telegram.WebAppData | |
| $data_check_arr = explode('&', rawurldecode($data_check_string)); | |
| $needle = 'hash='; | |
| $check_hash = FALSE; | |
| foreach($data_check_arr AS &$val){ |
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
| #!/bin/bash | |
| # Путь к корню проекта TShockLauncher (где TShockLauncher.csproj) | |
| PROJECT_DIR="/Users/makstashkevich/Documents/TShock/TShockLauncher" | |
| # Переходим в директорию проекта | |
| cd "$PROJECT_DIR" || { echo "Не удалось перейти в директорию $PROJECT_DIR"; exit 1; } | |
| echo "Сборка TShock..." |
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
| (для Debian пути и команды могут отличаться) | |
| sudo apt-get --purge remove mariadb* | |
| sudo apt-get autoremove | |
| sudo apt-get autoclean | |
| если возникают ошибки при удалении - | |
| заходим в папку /var/lib/dpkg/info | |
| и удаляем там всё что начинается на mariadb и на mysql | |
| повторяем предыдущие три команды |
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
| map $http_upgrade $connection_upgrade { | |
| default upgrade; | |
| '' close; | |
| } | |
| # Сервер для HTTP (редирект на HTTPS) | |
| server { | |
| listen 80; | |
| listen [::]:80; # Поддержка IPv6 | |
| server_name www.site.com site.com; |
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
| // Bot token | |
| const bot_token = '0123456789:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'; | |
| // https://core.telegram.org/bots/webapps#validating-data-received-via-the-web-app | |
| function isValidHash() { | |
| // Parse query data | |
| const parsedData = Telegram.Utils.urlParseQueryString(Telegram.WebApp.initData) | |
| // Get Telegram hash | |
| const hash = parsedData.hash |
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
| /** | |
| * Checks if the specified Web Storage API exists and is accessible | |
| * @param storage - Web Storage API | |
| * @returns true, if the Web Storage API is accessible | |
| */ | |
| const isStorageEnabled = (storage?: Storage): storage is Storage => { | |
| if (!storage) return false; | |
| try { | |
| const key = `__storage__test`; | |
| storage.setItem(key, ''); |
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
| <?php | |
| /** | |
| * Multibyte String Pad | |
| * | |
| * Functionally, the equivalent of the standard str_pad function, but is capable of successfully padding multibyte strings. | |
| * | |
| * @param string $input The string to be padded. | |
| * @param int $pad_length The length of the resultant padded string. | |
| * @param string $pad_string The string to use as padding. Defaults to space. |
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
| /** | |
| * ECMA2015 | |
| */ | |
| function convertHex(hexCode, opacity = 1){ | |
| var hex = hexCode.replace('#', ''); | |
| if (hex.length === 3) { | |
| hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2]; | |
| } |
NewerOlder