Skip to content

Instantly share code, notes, and snippets.

View VladislavTitov's full-sized avatar

Vladislav Titov VladislavTitov

  • Russia, Kazan
View GitHub Profile
@VladislavTitov
VladislavTitov / coc-settings.json
Last active April 20, 2024 16:12
My coc.nvim configuration
{
"diagnostic.displayByAle": true,
"pyright.enable": true,
"python.formatting.provider": "ruff",
"python.linting.ruffEnabled": true,
"pyright.organizeimports.provider": "isort",
"python.pythonPath": "/usr/bin/python3",
"languageserver": {
"python3": {
#!/bin/bash
filename=$1
dest=$2
echo "`find -path "./*$filename"`" | while read line
do
cp --parents "$line" "$dest"
done
#!/usr/bin/bash
sourceName=$1
destName=$2
find -name "$sourceName" | while read foundName
do
destDir=`dirname "$foundName"`
mv "$foundName" "$destDir/$destName"
done
fun updateStatusBar(activity: Activity, lightStatusBar: Boolean) =
activity.window.apply {
when {
Build.VERSION.SDK_INT >= Build.VERSION_CODES.M -> {
if (lightStatusBar) {
decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_LAYOUT_STABLE or View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN or View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
} else {
decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_LAYOUT_STABLE or View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
}
statusBarColor = ResourcesCompat.getColor(activity.resources, android.R.color.transparent, null)
alias adog='git log --all --decorate --oneline --graph'
alias graph1="git log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all"
alias graph2="git log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all"
while IFS="" read -r p || [ -n "$p" ]
do
export PATH="$p:$PATH"
done < ~/my_paths
@VladislavTitov
VladislavTitov / .vimrc
Last active April 20, 2024 15:58
My vim config file
set nocompatible
filetype off
syntax enable
set encoding=utf-8
set number " show line numbers
set showcmd " show command in bottom bar
set cursorline " highlight current line
set signcolumn=yes " show column in front of line number column, used by linter, e.g.
set wrap
set mouse=a
@VladislavTitov
VladislavTitov / DateSerializer.kt
Created November 13, 2018 08:12
kotlinx.serialization custom date serializer
import kotlinx.serialization.Serializer
import kotlinx.serialization.KSerializer
import kotlinx.serialization.SerialDescriptor
import kotlinx.serialization.Encoder
import kotlinx.serialization.Decoder
import kotlinx.serialization.internal.StringDescriptor
import java.text.DateFormat
import java.text.SimpleDateFormat
import java.util.Date
import java.util.Locale