Card columns can also be extended and customized with some additional code. Shown below is an extension of the .card-columns class using the same CSS we use—CSS columns— to generate a set of responsive tiers for changing the number of columns.
.card-columns {
@include media-breakpoint-only(lg) {
column-count: 4;
}
@include media-breakpoint-only(xl) {
column-count: 5;
}
}
version: "3.5"
services:
db:
build:
context: ./db
dockerfile: postgresql.Dockerfile
env_file:
- .env
restart: always
volumes:
- postgres:/var/lib/postgresql/data
ports:
- "127.0.0.1:5432:5432"
web:
build: .
restart: always
env_file:
- .env
- secret.env
command: gunicorn --bind 0.0.0.0:8080 --user nginx you_proj.wsgi
volumes:
- django-static:/data
ports:
- "127.0.0.1:8080:8080"
volumes:
django-static:
postgres:
FROM python:3.6-alpine
RUN apk add build-base python-dev py-pip jpeg-dev zlib-dev
ENV LIBRARY_PATH=/lib:/usr/lib
WORKDIR /code
ADD requirements.txt /code/
RUN apk update
RUN apk upgrade
RUN apk --no-cache add \
python3 \
python3-dev \
postgresql-client \
postgresql-dev \
build-base \
gettext
RUN pip3 install --upgrade pip
RUN pip3 install -r requirements.txt
RUN set -x ; \
addgroup -g 101 -S nginx ; \
adduser -u 101 -D -S -G nginx nginx && exit 0 ; exit 1
RUN mkdir -p /data/static/ && mkdir -p /data/media/
ADD . /code/
RUN /code/maxmind.sh
ENV PYTHONUNBUFFERED 1
docker exec -it container_name_1 python3 manage.py collectstatic --noinput
docker exec -it container_name_1 python3 manage.py migrate
An asynchronous event driven PHP framework for easily building fast, scalable network applications. Supports HTTP, Websocket, SSL and other custom protocols. Supports libevent, HHVM, ReactPHP.
<?php
use Workerman\Worker;
require_once './Workerman/Autoloader.php';
// Create A Worker and Listens 2346 port, use Websocket protocol
$ws_worker = new Worker("websocket://0.0.0.0:2346");
// 4 processes
$ws_worker->count = 4;
// Emitted when new connection come
$ws_worker->onConnect = function($connection)
{
// Emitted when websocket handshake done
$connection->onWebSocketConnect = function($connection)
{
echo "New connection\n";
};
};
// Emitted when data is received
$ws_worker->onMessage = function($connection, $data)
{
// Send hello $data
$connection->send('hello ' . $data);
};
// Emitted when connection closed
$ws_worker->onClose = function($connection)
{
echo "Connection closed";
};
// Run worker
Worker::runAll();
>>> from django.db.models import Avg, Max, Min
>>> Book.objects.aggregate(Avg('price'), Max('price'), Min('price'))
{'price__avg': 34.35, 'price__max': Decimal('81.20'), 'price__min': Decimal('12.99')}
@api_view(['GET'])
@renderer_classes([JSONRenderer])
def get_data(request, format=None):
"""
A view that returns JSON.
"""
data = {
"import_id": 7
}
content = {'data': data}
return Response(content)
That’s one of the most significant challenges on iOS as there will be no prompts or invitations from Safari (known as Web App Banners on Android). So the user has to go to your PWA URL somehow within Safari and then manually press the Share icon and then “Add to Home Screen.” There will be no indication that a website you are visiting is a PWA.
bot.send_message(
chat_id,
"Example text with a phone [+79991234567](tel:+79991234567)",
parse_mode='Markdown'
)
Ссылка для автоматической подписки на инстаграм аккаунт?
подписка работает только по клику на кнопку "подписаться" в самом инстаграме?
чтобы был больший контроль над доступом к интернету (когда что-то идет не так у провайдера - приходится слишком долго ждать).
from twilio.rest import Client
from . import app
from flask import session
import random
def send_confirmation_code(to_number):
verification_code = generate_code()
send_sms(to_number, verification_code)
session['verification_code'] = verification_code
return verification_code
def generate_code():
return str(random.randrange(100000, 999999))
def send_sms(to_number, body):
account_sid = app.config['TWILIO_ACCOUNT_SID']
auth_token = app.config['TWILIO_AUTH_TOKEN']
twilio_number = app.config['TWILIO_NUMBER']
client = Client(account_sid, auth_token)
client.api.messages.create(to_number,
from_=twilio_number,
body=body)
docker-compose down
--force --volumes
--disable-partition-engine-check
to mysql section in docker-compose.yml
docker-compose up -d
to set it up in background.Как реализовать реферальную систему в Telegram боте?
Deep linking
Telegram bots have a deep linking mechanism, that allows for passing additional parameters to the bot on startup. It could be a command that launches the bot — or an auth token to connect the user's Telegram account to their account on some external service.
Each bot has a link that opens a conversation with it in Telegram — https://telegram.me/. You can add the parameters start or startgroup to this link, with values up to 64 characters long. For example:https://telegram.me/triviabot?startgroup=test
но перехват трафика - это неправомерный доступ к личной информации (уголовный кодекс).
Можно ли эксель назвать субд?