Skip to content

Instantly share code, notes, and snippets.

View natiginfo's full-sized avatar

Natig Babayev natiginfo

View GitHub Profile
import SwiftUI
struct SwipableCardsView: View {
var numbers = (1...5)
var body: some View {
GeometryReader { geo in
TabView {
ForEach(numbers, id: \.self) { i in
VStack {
import typer
def main(
city: str = typer.Option(..., prompt=True),
country: str = typer.Option(..., prompt=True)
):
# write some code
print(city, country)
@natiginfo
natiginfo / .vimrc
Last active November 28, 2021 19:42
noremap <Up> <Nop>
noremap <Down> <Nop>
noremap <Left> <Nop>
noremap <Right> <Nop>
set number
set relativenumber
syntax enable
set incsearch
set autoindent
set ruler
import android.content.Context
import android.net.Uri
import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
@natiginfo
natiginfo / ktlint_fix_changed_files.sh
Created May 22, 2019 12:01
Script for fixing ktlint issues only on files that differs from master branch
#!/bin/bash
CHANGED_FILES=($(git diff master --name-only "*.kt"))
for file_path in "${CHANGED_FILES[@]}"
do
ktlint -F ${file_path}
done
@natiginfo
natiginfo / ktlint_check_changed_files.sh
Last active May 22, 2019 12:01
Script for running ktlint only on files that differs from master branch
#!/bin/bash
CHANGED_FILES=($(git diff master --name-only "*.kt"))
for file_path in "${CHANGED_FILES[@]}"
do
ktlint ${file_path}
done
@natiginfo
natiginfo / MainThreadExecutor.kt
Created May 17, 2019 08:29
Main thread executor
import android.os.Handler
import android.os.Looper
import java.util.concurrent.Executor
class MainThreadExecutor : Executor {
private val mainThreadHandler = Handler(Looper.getMainLooper())
override fun execute(command: Runnable) {
mainThreadHandler.post(command)
}
@natiginfo
natiginfo / release_notes_generator.sh
Last active April 10, 2019 11:18
Shell script for generating release notes based on merge history from previous last tag to latest tag.
#!/bin/bash
FILE_NAME="release_notes.txt"
COMMIT_HASH_FOR_TAG_BEFORE_LAST=$(git rev-list --tags --skip=1 --max-count=1)
TAG_BEFORE_LAST=$(git describe --abbrev=0 --tags $COMMIT_HASH_FOR_TAG_BEFORE_LAST)
LAST_TAG=$(git describe --abbrev=0 --tags)
LOGS=$(git log $TAG_BEFORE_LAST..$LAST_TAG --pretty="* format:%s" --merges)
$(rm -rf $FILE_NAME)
echo -e "$LAST_TAG\n$LOGS" >> $FILE_NAME