Skip to content

Instantly share code, notes, and snippets.

View Rosherh's full-sized avatar
🎯
Focusing

Gorelykh Anatoly Rosherh

🎯
Focusing
  • Lisboa
View GitHub Profile
@Rosherh
Rosherh / app-build.gradle.kts
Created December 10, 2023 13:34 — forked from DRSchlaubi/app-build.gradle.kts
Flutter Kotlin Gradle DSL
import java.util.Properties
import java.nio.file.Files
val localProperties = Properties()
val localPropertiesFile = rootProject.file("local.properties").toPath()
if (Files.exists(localPropertiesFile)) {
Files.newBufferedReader(localPropertiesFile).use { reader ->
localProperties.load(reader)
}
}
@Rosherh
Rosherh / config.md
Created November 17, 2023 12:00
Raspberry Pi boot/config.txt (RU).md

Raspberry Pi считывает файл config.txt силами GPU до инициализации ядра процессора. Данный конфигурационный файл используется для настройки различных системных параметров.

  • Формат файла
  • Память
  • Видео
    • Настройка видеорежима
    • Какие значения подходят для моего дисплея?
  • Лицензирование кодеков
  • Загрузка
  • Производительность
@Rosherh
Rosherh / main.py
Created May 24, 2023 17:48
Example Google Style Python Docstrings
# -*- coding: utf-8 -*-
"""Example Google style docstrings.
This module demonstrates documentation as specified by the `Google Python
Style Guide`_. Docstrings may extend over multiple lines. Sections are created
with a section header and a colon followed by a block of indented text.
Example:
Examples can be given using either the ``Example`` or ``Examples``
sections. Sections support any reStructuredText formatting, including
@Rosherh
Rosherh / main.dart
Created February 1, 2023 19:50
Example Support InAppPurchase in App
import 'dart:async';
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:in_app_purchase/in_app_purchase.dart';
import 'package:in_app_purchase_android/billing_client_wrappers.dart';
import 'package:in_app_purchase_android/in_app_purchase_android.dart';
import 'package:in_app_purchase_storekit/in_app_purchase_storekit.dart';
import 'package:in_app_purchase_storekit/store_kit_wrappers.dart';
import 'consumable_store.dart';
background_opacity: 0.92
font:
size: 14
window:
padding:
x: 0
y: 0
decorations: full
dynamic_padding: true
"""
Компания делает ежемесячную рассылку по базе клиентов — в ней новости и предложения от партнёров.
Известно, что рассылку открывают 40% получателей.
Один партнёр спланировал рекламную кампанию и рассчитывает на охват в 9 тысяч пользователей.
Посчитайте, с какой вероятностью ожидания клиента будут оправданы, если сделать рассылку на 23 тысячи человек.
Выведите значение p_threshold на экран.
"""
from scipy import stats as st
import math as mt
@Rosherh
Rosherh / updatimg_ubuntu_16.04_to_20.04.md
Last active February 25, 2025 12:30
Обновление ОС Ubuntu 16.04 LTS до 20.04 LTS

Краткое описание: Чтобы обновить Ubuntu с 16.04 LTS до последней версии, необходимо обновиться до 18.04 LTS, затем до 20.04 LTS и т.д.

Можно использовать мультиплексер TMUX, в случае проблем с сетью или vpn, тем самым обрыв соединения не повлияет на работу сервера и продолжит выполнять команды.

tmux new -s vm
ssh @ip
@Rosherh
Rosherh / pgbouncer
Created April 5, 2021 09:59
Start work Postgresql with PgBouncer
# Install lib.
sudo apt install pgbouncer
# Edit configure file.
sudo vi /etc/pgbouncer/pgbouncer.ini
____
[databases]
# Add connection for your postgres.
* = host=localhost port=54321