Skip to content

Instantly share code, notes, and snippets.

View Eragoo's full-sized avatar
👻
Working from home

Yevhenii Kukhol Eragoo

👻
Working from home
View GitHub Profile
@Eragoo
Eragoo / redeploy.sh
Created April 7, 2024 07:10
redeploy react github pages
REPO_PATH="../j2j"
npm run build
find $REPO_PATH/* -not -name 'CNAME' -delete
cp -R build/* $REPO_PATH
cd $REPO_PATH
git add .
git commit -m "redeploy"
git push
function generatePojoClass(json) {
return parseObj(json, "MyClass");
}
function getJavaType(jsonType, key, value) {
switch (jsonType) {
case 'String':
return 'String';
case 'Long':
return 'Long';
from ryu.base import app_manager
from ryu.controller import ofp_event
from ryu.controller.handler import CONFIG_DISPATCHER, MAIN_DISPATCHER
from ryu.controller.handler import set_ev_cls
from ryu.ofproto import ofproto_v1_3
class MySDNApp(app_manager.RyuApp):
OFP_VERSIONS = [ofproto_v1_3.OFP_VERSION]
def __init__(self, *args, **kwargs):
import sys
import pyshark
from PyQt6.QtWidgets import QApplication, QMainWindow, QTextEdit, QVBoxLayout, QWidget
from PyQt6.QtCore import QTimer
import threading
def capture_packets(text_edit):
capture = pyshark.LiveCapture(interface='Wi-Fi')
public class WayForPayClient {
private final RestTemplate restTemplate;
private final WayForPayProperties wayForPayProperties;
public void createPayment(SubscriptionType subscriptionType, Long userId) {
String formUrl = "https://secure.wayforpay.com/pay";
String orderReference = subscriptionType.name() + ":"+userId + ":" + System.currentTimeMillis();
long time = System.currentTimeMillis();
import asyncio
from telethon import TelegramClient
from telethon.tl import functions
from telethon.tl.types import UserStatusOnline, UserStatusOffline
async def authorize(client):
is_authorized = await client.is_user_authorized()
if not is_authorized:
@Eragoo
Eragoo / docker-compose.yml
Created December 21, 2022 17:29
docker-compose for traefik with subdomains
version: '3.7'
services:
app-landing:
image: landingimage #nginx or smth
container_name: app-landing
restart: always
labels:
- traefik.http.routers.landing.rule=Host(`landing.${DOMAIN}`)
- traefik.http.routers.landing.entrypoints=https
- traefik.http.routers.landing.tls=true
public class Lab1Application {
public static void main(String[] args) {
count( 1, 0.5,5, 7);
}
static void count(double l, double Tobs, int n, int m) {
// параметр завантаження системи
double alpha;
// імовірність того, що всі канали обслуговування вільні
double Po;
{
"application_fee_percent": null,
"automatic_tax": {
"enabled": false
},
"billing_cycle_anchor": 1652282579,
"billing_thresholds": null,
"cancel_at": null,
"cancel_at_period_end": false,
"canceled_at": null,
public String createSubscription(SubscriptionType subscriptionType, AuthenticatedUser user) {
OrganizationUser organizationUser = organizationUserRepository.getById(user.getOrganizationUserId());
if (!organizationUser.isOwner()) {
throw new AccessDeniedProblem("This user not allowed to set up subscription! Just organization owner allowed to do that.");
}
String stripeCustomerId = organizationUser.getStripeCustomerId();
if (stripeCustomerId == null) {
stripeCustomerId = createCustomer(organizationUser.getUser());