Skip to content

Instantly share code, notes, and snippets.

View POMXARK's full-sized avatar
🏠
Нет предела совершенству.

Бушуев Роман POMXARK

🏠
Нет предела совершенству.
View GitHub Profile
@POMXARK
POMXARK / Dollar.java
Created June 4, 2024 13:02
TDD java junit
public class Dollar {
int amount;
Dollar(int amount) {
}
void times(int multiplier) {
}
}
@POMXARK
POMXARK / access.log
Last active June 4, 2024 09:55
parse_access_apache_log_txt
127.0.0.1 - - [01/Apr/2022:18:19:15 +1000] "\x16\x03\x01\x02" 400 326 "-" "-"
127.0.0.1 - - [01/Apr/2022:18:19:15 +1000] "\x16\x03\x01\x02" 400 326 "-" "-"
127.0.0.1 - - [01/Apr/2022:18:20:15 +1000] "\x16\x03\x01\x02" 400 326 "-" "-"
127.0.0.1 - - [01/Apr/2022:18:20:15 +1000] "\x16\x03\x01\x02" 400 326 "-" "-"
::1 - - [01/Apr/2022:18:22:10 +1000] "GET /phpmyadmin/ HTTP/1.1" 200 18361 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.74 Safari/537.36 Edg/99.0.1150.55"
::1 - - [01/Apr/2022:18:22:13 +1000] "GET /phpmyadmin/themes/pmahomme/css/theme.css?v=5.1.1&nocache=2250110580ltr&server=1 HTTP/1.1" 200 214799 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.74 Safari/537.36 Edg/99.0.1150.55"
::1 - - [01/Apr/2022:18:22:14 +1000] "GET /phpmyadmin/js/messages.php?l=ru&v=5.1.1 HTTP/1.1" 200 12908 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.74 Safari/5
@POMXARK
POMXARK / main.py
Created June 4, 2024 08:25
expiration_date
# python = 3.9.4
import datetime
now = datetime.datetime.now()
print(now.strftime("%d.%m.%Y %H:%M:%S"))
date_today = now.strftime("%a %b %d 8:00:00 %Y")
date_today = datetime.datetime.strptime(date_today, "%a %b %d %H:%M:%S %Y")
date_today_f = date_today.strftime("%d.%m.%Y %H:%M:%S")
@POMXARK
POMXARK / main.py
Created June 2, 2024 17:54
pyqt webview javascript -> python example qtwebchannel PySide6 QWebChannel inject script
import json
from PySide6 import QtCore, QtWebChannel
from PySide6.QtWidgets import QApplication
from PySide6.QtWebEngineWidgets import QWebEngineView
from PySide6.QtWebChannel import QWebChannel
from PySide6.QtCore import QObject, Slot, QUrl, QJsonValue
import os
import sys
from PyQt5.QtCore import QUrl, QSize
from PyQt5.QtWebEngineWidgets import QWebEngineView, QWebEngineScript, QWebEnginePage, QWebEngineProfile
from PyQt5.QtWidgets import QToolBar, QAction, QLineEdit, QLabel, QMainWindow, QTabWidget, QApplication
from PyQt5.QtNetwork import QNetworkCookie
import http.cookiejar
def create_script(name, src, injection_point = QWebEngineScript.DocumentCreation, world = QWebEngineScript.MainWorld, on_subframes = True):
script = QWebEngineScript()
script.setSourceCode(src)
@POMXARK
POMXARK / index.html
Last active June 2, 2024 16:01 — forked from mphuie/index.html
pyqt webview javascript -> python example qtwebchannel PySide6 QWebChannel QWebEngineView
<html>
<head>
<script src="qrc:///qtwebchannel/qwebchannel.js"></script>
<style>
::selection {
background: transparent;
}
</style>
</head>
@POMXARK
POMXARK / qwebchannelexample.py
Created June 2, 2024 09:52 — forked from vidjuheffex/qwebchannelexample.py
QWebChannel Example Script
"""create a remote connection to a webapp."""
import sys
import json
from PySide6.QtWidgets import QApplication, QMainWindow
from PySide6.QtNetwork import QHostAddress, QSslSocket
from PySide6.QtWebChannel import QWebChannel, QWebChannelAbstractTransport
from PySide6.QtWebSockets import QWebSocketServer
from PySide6.QtWebEngineWidgets import QWebEngineView
@POMXARK
POMXARK / qwebchannel-client.html
Created June 2, 2024 09:32 — forked from gencer/qwebchannel-client.html
QWebChannel Javascript Connector
<!DOCTYPE html>
<html>
<head>
<title>QWebChannel Client</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script type="text/javascript" src="qwebchannel.js"></script>
@POMXARK
POMXARK / help.txt
Last active May 25, 2024 11:38
add python version linux pycharn
sudo apt install python3.8 -y
sudo apt install python3.8-distutils
python3.8 -m pip install setuptools
sudo apt install python3.8-venv
python3.8 -m venv .venv
<?php
namespace App\Http\Middleware;
use Filament\Facades\Filament;
use Filament\Models\Contracts\FilamentUser;
use Illuminate\Auth\Middleware\Authenticate as Middleware;
use Illuminate\Support\Facades\Session;
class RedirectIfNotFilamentAdmin extends Middleware