Skip to content

Instantly share code, notes, and snippets.

View Munchen777's full-sized avatar
🏠
Working from home

munchen777 Munchen777

🏠
Working from home
View GitHub Profile
@LowerDeez
LowerDeez / base.html
Last active February 2, 2025 13:42
Django. Simple Cart app for basic shop.
<div class="cart">
{% with total_items=cart|length %}
{% if cart|length > 0 %}
Ваша корзина:
<a href="{% url "cart:CartDetail" %}">
{{ total_items }} тов. {{ cart.get_total_price }} руб.
</a>
{% else %}
Корзина пустая
{% endif %}
@Serganbus
Serganbus / шпаргалка по psql.txt
Last active March 8, 2025 23:54
шпаргалка по psql
Полезные ключи программы psql
-U - Указываем пользователя, например postgres
-W - Приглашение на ввод пароля
-d название_БД - Подключение к БД название_БД
-h имя_хоста - Подключение к хосту имя_хоста
-p порт - По какому порту постгря ожидает подключения
-c команда - Выполнение команды SQL без выхода в интерактивный режим
-f file.sql - Выполнение команд из файла file.sql
-S - Однострочный режим, то есть, переход на новую строку будет выполнять запрос (избавляет от ; в конце конструкции SQL)
@Birdi7
Birdi7 / callback_data_factory_simple.py
Last active October 29, 2024 18:25
A simple example of usage of callback data factory from aiogram
"""
This is a simple example of usage of CallbackData factory
For more comprehensive example see callback_data_factory.py
"""
import asyncio
import logging
from aiogram import Bot, Dispatcher, executor, types
from aiogram.contrib.fsm_storage.memory import MemoryStorage
@wtw24
wtw24 / docker_rus.md
Last active April 21, 2025 07:30
Шпаргалка с командами Docker

Шпаргалка с командами Docker

1552317264965 1552317537397 1552317711879

1552318467562 1552318531067 1552318577900 1552318614839

@farhad0085
farhad0085 / Deploy Django and React APP in a production VPS.md
Last active April 5, 2025 03:10
Deploy Django and React APP in a production VPS (Django + Celery + React + PostgreSQL + NGINX + Ubuntu Server)

Deploy Django and React APP in a production VPS (Django + React + PostgreSQL + NGINX + Ubuntu Server)

Assuming You have backend and frontend codes in /home/backend and /home/frontend/ (Use git to upload)

Install required Packages from the Ubuntu Repositories

sudo apt-get update
sudo apt-get install python3-pip python3-dev libpq-dev postgresql postgresql-contrib nginx