Skip to content

Instantly share code, notes, and snippets.

View And42's full-sized avatar
💭
¯\_(ツ)_/¯

Andrey Skobtsov And42

💭
¯\_(ツ)_/¯
View GitHub Profile
@And42
And42 / Scrollbar.kt
Last active September 12, 2025 15:09
Jetpack compose scrollbar for scrollable modifier and LazyList
package com.pixelcurves.terlauncher.ui.design_system.components
import androidx.annotation.FloatRange
import androidx.compose.animation.core.animateFloatAsState
import androidx.compose.foundation.Canvas
import androidx.compose.foundation.ScrollState
import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.layout.wrapContentWidth
import androidx.compose.foundation.lazy.LazyListLayoutInfo
@And42
And42 / heavy_build.yml
Created January 10, 2023 15:02
Example NET 6 + Inno Setup GitHub actions for building
name: Heavy build
on:
push:
branches: [ "releases/**" ]
jobs:
build:
runs-on: windows-latest
@And42
And42 / net-6.0-windows-x64-framework-dependent.pubxml
Last active January 10, 2023 15:00
Example publish profiles for NET 6 desktop
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>bin\publish\Release\net6.0-windows-x64-framework-dependent</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
@And42
And42 / build.gradle
Created February 17, 2021 20:09
Meaningful android gradle output names
android {
applicationVariants.all { variant ->
variant.outputs.all { output ->
output.outputFileName = "${applicationId} ${variant.versionCode} (${variant.versionName}).apk"
}
}
}

General

Pull Request: ClickHouse/ClickHouse#9545

CppCon 2015: Chandler Carruth "Tuning C++: Benchmarks, and CPUs, and Compilers! Oh My!": https://www.youtube.com/watch?v=nXaxk27zwlk

  • C++ flags: -fno-omit-frame-pointer- позволяет perf понимать, в какой части программы он находится
  • perf record -g - позволяет записывать стек вызовов
  • perf report -g 'graph,0.5,caller' - graph: нормальзует процентное соотношение затраченного времени на функцию к общему времени, 0.5: порог отображения функций (%?), caller: показывает при раскрытии элемента не функции, которые вызывали раскрываемую, а функции которые были вызваны раскрываемую
@And42
And42 / zzz_dependencies.txt
Last active May 13, 2020 13:29
Copies dependent libraries (.dll) with their dependencies stored in the same directory to the directory containing this executable. Copies <library_name>.dll, <library_name>.pdb and <library_name>.xml files for each library. Copy is performed only if a new library's version is more than the version of the existing one
<absolute paths to libraries we want to copy with dependencies> - !!! remove this line before using the script !!!
only_dll
<absolute paths to libraries we want to copy without dependencies> - !!! remove this line before using the script !!!
@And42
And42 / Enable long paths for the app in windows
Last active December 4, 2018 16:11
Enables long paths handling when long paths are enabled in the registry (HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem\LongPathsEnabled) or in the local group policies (Computer Configuration\Administrative Templates\System\Filesystem\Enable `NTFS/Win32` long paths)
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
...
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<longPathAware xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">true</longPathAware>
</windowsSettings>
</application>