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 json | |
import aiohttp | |
async def pay(amount, redirect, account, currency="RUB", description=""): | |
""" | |
amount - Amount in RUB, can be string | |
account - Your PayAnyWay Business account number | |
redirect - Redirect to (in any case) |
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 | |
use PHPMailer\PHPMailer\PHPMailer; | |
use PHPMailer\PHPMailer\Exception; | |
require 'deps/phpmailer/phpmailer/PHPMailer-6.9.1/src/Exception.php'; | |
require 'deps/phpmailer/phpmailer/PHPMailer-6.9.1/src/PHPMailer.php'; | |
require 'deps/phpmailer/phpmailer/PHPMailer-6.9.1/src/SMTP.php'; | |
?> |
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 | |
// с линуксом не совместим:) меняйте обратные слэши на прямые | |
$dwebp="C:\\dwebp.exe";// путь к dwebp | |
$log=""; | |
if(isset($_GET['webpfolder']) && isset($_GET['pngfolder'])){ | |
header("Content-Type: application/json"); | |
if(!is_dir($_GET['webpfolder'])){ | |
die(json_encode(['success'=>false,'error'=>'Папка не существует, или нет прав'])); | |
} | |
if(!is_dir($_GET['webpfolder'].'\\'.$_GET['pngfolder']) and file_exists($_GET['webpfolder'].'\\'.$_GET['pngfolder'])==false){ |
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 json | |
import base64 | |
import os | |
# make sure the output directory exists before running! | |
folder = os.path.join(os.getcwd(), "imgs") | |
if not os.path.exists(folder): | |
os.mkdir(folder,777) |
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 | |
if (!defined("translator_loaded")) { | |
$lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2); | |
$acceptLang = ['en','ru']; | |
$user_pref_langs = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']); | |
foreach($user_pref_langs as $idx => $llang) { | |
$llang = substr($llang, 0, 2); | |
if (in_array($llang, $acceptLang)) { | |
$lang=$llang; |
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 | |
$disablePlayDirect = true; // Отключить прямое воспроизведение (по умолчанию - true) | |
$useURL = "http://files.pushnoy.ru/tut/"; // Базовый URL, от которого отталкиваются все другие ссылки | |
$songDOM = new DOMDocument;// Новый DOMDocument | |
$songDOM->loadHTML(file_get_contents($useURL)); // Загружаем в DOMDocument сгенерированный сервером HTML-код со списком файлов(в том числе музыкальных) | |
function randomTrack($songDOM,$useURL){ // Случайный трек; Возвращет URL к песне(String) | |
$links = $songDOM->getElementsByTagName('a'); // Берём все элементы ссылок | |
$validLinks = array(); // Создаём массив "Верных" ссылок | |
foreach ($links as $link) {// Перебираем все элементы ссылок | |
$url =$link->getAttribute("href"); // Получаем ссылку у элемента ссылки |
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
# usage: python run_uploaded_software.py ProgramName 1/0 | |
# 0 - close running program and run ProgramName | |
# 1 - close running program, wait for ProgramName to finish, run previous program. | |
# ProgramName - program name, uploaded on NXT | |
# Requires pyusb, setuptools, setuptools-scm, nxt-python. You can install them from attachement below. | |
import nxt.locator | |
import sys | |
import time | |
b = nxt.locator.find_one_brick() | |
if (str(sys.argv[2]) == "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
<?php | |
function getPics(){ | |
$dom = new DOMDocument(); | |
$options = array( | |
'http'=>array( | |
'method'=>"GET", | |
'header'=>"Accept-language: en\r\n" . | |
"Cookie: foo=bar\r\n" . // check function.stream-context-create on php.net |
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 | |
// Парсер видео с resh.edu.ru на PHP. | |
// Нужен DOMDocument а также ссылка на основную часть с плеером player.js. Пример: https://resh.edu.ru/subject/lesson/6111/main/200549/ | |
// $lnk - ссылка на основную часть | |
function get_widget($lnk){ | |
libxml_use_internal_errors(true); | |
if (empty($lnk) == true) { | |
return false; | |
}else{ | |
$html = new DOMDocument(); |