Skip to content

Instantly share code, notes, and snippets.

View Khazbs's full-sized avatar
🐺
.let { it.be() }

Arthur Khazbulatov Khazbs

🐺
.let { it.be() }
  • TelePat, LLC
  • Moscow, Russia
  • 04:58 (UTC +03:00)
View GitHub Profile
@Khazbs
Khazbs / edge-to-edge.md
Last active May 8, 2024 16:18
If enableEdgeToEdge sucks for your Android activity's Compose UI, try this instead!

Go Edge-to-Edge on Android in a More Customizable Way

Google currently recommends calling enableEdgeToEdge() in order to make your Compose UI go edge-to-edge. However, the result it yields may be slightly different from how you really want your app's activity to look. For example, an unwanted semi-transparent scrim may appear behind the navigation bar. Don't worry, it's actually possible to tweak most of this stuff!

Here I show the three steps I take to go edge-to-edge. You can try it yourself and see if you like it too! If you have any questions, suggestions for improvement or your own preferred solutions, feel free to leave a comment down below, I'm open and curious to read them!

@Khazbs
Khazbs / .bashrc
Last active September 29, 2022 11:34
Add this to your .bashrc to get a handy bak function for backing up files and directories
# Create backup copies of files or directories
bak() {
local name="$1.bak"
if [ -e "$name" ]; then
local -i num=2
while [ -e "$name$num" ]; do
num+=1
done
cp -rv "$1" "$name$num"
@Khazbs
Khazbs / Theme.kt
Last active November 14, 2023 19:56
This snippet might help you make a Material Design 3 theme for your Jetpack Compose app
package my.awesome.package // put your package name here
import android.app.Activity
import android.os.Build
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.material3.*
import androidx.compose.runtime.Composable
import androidx.compose.runtime.SideEffect
import androidx.compose.ui.graphics.toArgb
import androidx.compose.ui.platform.LocalContext
@Khazbs
Khazbs / nabla.py
Created March 12, 2021 14:12
Calculate function gradient via numpy
import numpy as np
def nabla(f):
n = f.__code__.co_argcount
d = (np.arange(-100, 101, 1) for i in range(n))
x = np.meshgrid(*d)
return np.gradient(f(*x))
@Khazbs
Khazbs / 2.md
Last active February 27, 2021 00:12
2. Формулирование функциональных требований к прототипу решения

Функциональные требования к прототипу решения

Must have:

  • Автоматическое получение и анализ данных
  • Интерпретируемые результаты анализа и рекомендации
  • Минимальная склонность к ложноотрицательным результатам
  • Возможность мониторинга и отправки уведомлений в реальном времени

Nice to have:

  • Высокоинформативный пользовательский интерфейс
@Khazbs
Khazbs / 1.2.md
Last active February 19, 2021 21:21
1.2. Разработка документа, в котором четко обозначены задачи проекта, карта целей, которые должны быть достигнуты для удовлетворения задач проекта, ограничения глубины погружения в тему, а также критерии успешности выполнения задач проекта

Задачи

  • Формализовать понятия финансовых манипуляций
  • Выявить стратегии противодействия манипуляциям
  • Описать требования и ограничения
  • Найти источники данных об ордерах
  • Произвести предварительный анализ данных
  • Выбрать методы анализа данных
  • Описать модель выявления манипуляций
  • Описать модель рекомендации стратегий противодействия
@Khazbs
Khazbs / .bashrc
Created February 10, 2021 19:41
Having this in your ~/.bashrc will allow you to write persistent alias into ~/.bash_aliases with the aka command (and use them without sourcing ~/.bashrc)
# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
# Write new alias to ~/.bash_aliases
@Khazbs
Khazbs / System Integrator.md
Last active December 6, 2020 14:19
IT System Integrator EA Transformation Project

IT System Integrator

About the company

There is a B2B IT system integrator company.

The company provides the following services to their customers:

  • Enterprise infrastructure analyzis & optimization
  • Enterprise IS development & deployment
@Khazbs
Khazbs / DateTimeExtensions.cs
Last active October 30, 2020 21:43
C# DateTime extensions to get the date of 'Last {DayOfTheWeek}' or 'Next {DayOfTheWeek}', see tests for usage examples
using System;
namespace MyNamespace
{
public static class DateTimeExtensions
{
public static DateTime GetLast(this DateTime date, DayOfWeek day) =>
date.AddDays(-(DaysInWeek - (int) day + (int) date.DayOfWeek) % DaysInWeek);
public static DateTime GetNext(this DateTime date, DayOfWeek day) =>
@Khazbs
Khazbs / lectures.md
Last active December 14, 2020 19:15
Моделирование Статических Зависимостей

Моделирование Статистических Зависимостей

Лекция 1

Этапы работы над статистической моделью

  1. Формализация
  2. Квантификация данных
    • Шкалы:
  3. Номинальная