Skip to content

Instantly share code, notes, and snippets.

View nsmirosh's full-sized avatar

Nikolay Miroshnychenko nsmirosh

View GitHub Profile
@nsmirosh
nsmirosh / git_log_formatter.py
Created September 2, 2021 10:19
Python program that parses the git log output and writes the formmatted output to a separate file
import re
first_message_index = 4
step_index = 6
def get_first_alphabetic_character_pos(s):
m = re.search(r'[a-z]', s, re.I)
if m is not None:
return m.start()
return 0
@nsmirosh
nsmirosh / Previews.kt
Created July 1, 2025 09:31
Vertical and Horizontal Previews
import android.content.res.Configuration
import androidx.compose.runtime.Composable
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.tooling.preview.Devices
@Preview(showBackground = true)
@Composable
fun DefaultPreview() {
MyScreen()
@nsmirosh
nsmirosh / PrettyPrint.kt
Created September 25, 2025 13:22
PrettyPrint with Ktor
fun buildHttpClient() = HttpClient(Okhttp){
val formatter = Json {
prettyPrint = true
isLenient = true
ignoreUnknownKeys = true
coerceInputValues = true
}
install(ContentNegotiation) {
json(formatter)
}
@nsmirosh
nsmirosh / gradle.properties
Created October 22, 2025 11:55
Gradle performance improvement
# This should be enabed by default - but just in case
org.gradle.daemon=true
# Most projects consist of multiple subprojects, some of which are independent.
# By default, Gradle runs only one task at a time - this removes this restriction.
org.gradle.parallel=true
# Enables incubating configuration-on-demand,
# where Gradle will attempt to configure only necessary projects.
org.gradle.configureondemand=true