Skip to content

Instantly share code, notes, and snippets.

View goltsevnet's full-sized avatar
:shipit:
Coding

Mark Goltsev goltsevnet

:shipit:
Coding
View GitHub Profile
@goltsevnet
goltsevnet / yandex_individual_payment.py
Created October 9, 2020 17:44
yandex payment individual react
payHandle(e) {
e.preventDefault();
this.myFormTargets.current.value = 'test'
this.myForm.current.submit()
}
<form ref={this.payHandle} className='pay' method="POST" action='https://money.yandex.ru/quickpay/confirm.xml' onSubmit={this.payHandle}>
<input type="hidden" name="receiver" value="41001261102xxxx"/>
<input type="hidden" name="formcomment" value={boostInfoPay}/>
<input type="hidden" name="short-dest" value={boostInfoPay}/>
import {CaseReducer, createSlice, PayloadAction} from "@reduxjs/toolkit";
const ProfileState = {
email: '' as string,
rating: 0 as number,
username: '' as string,
first_name: '' as string,
last_name: null as string | null,
slug: '' as string,
avatar: '/static/user.svg' as string,
@goltsevnet
goltsevnet / func_collector.py
Last active April 24, 2021 10:38
Сбощик функций
from inspect import getmembers, isfunction
import os
import pkgutil
# for example, let's take all the functions of the os module
# для примера возьмем все функции модуля OS
class CollectFunctions:
def __init__(self):
self.functions = dict()
@goltsevnet
goltsevnet / connections.py
Created May 30, 2021 20:01
aredis manager
from typing import Optional
from aioredis import Redis, create_redis_pool
class RedisCache:
def __init__(self):
self.redis_cache: Optional[Redis] = None
import os
import shutil
import time
import random
from movies.models import *
from tqdm import tqdm
from users.models import User
from model_bakery import baker
genre_names = [
from django.db import migrations
from main_app.models import Book
def change_author(apps, schema_editor):
Book.objects \
.filter(authors__first_name=['Аркадий', 'Борис'], authors__last_name=['Стругацкий']) \
.update('Суахили')
@goltsevnet
goltsevnet / Dockerfile
Created April 7, 2023 18:37
dockerfile for django
FROM python:3.11.2-slim
WORKDIR /opt/project
RUN pip3 install --upgrade pip
RUN apt-get update && apt-get upgrade -y && apt-get autoremove && apt-get autoclean
RUN apt-get install --no-install-recommends -y
RUN pip3 install --no-cache-dir poetry
COPY ./pyproject.toml /opt/project