Skip to content

Instantly share code, notes, and snippets.

@eugene-babichenko
eugene-babichenko / Makefile
Created September 28, 2019 13:33
Makefile for building version strings from Git data and including that version numbers into go programs
TAG_COMMIT := $(shell git rev-list --abbrev-commit --tags --max-count=1)
TAG := $(shell git describe --abbrev=0 --tags ${TAG_COMMIT} 2>/dev/null || true)
COMMIT := $(shell git rev-parse --short HEAD)
DATE := $(shell git log -1 --format=%cd --date=format:"%Y%m%d")
VERSION := $(TAG:v%=%)
ifneq ($(COMMIT), $(TAG_COMMIT))
VERSION := $(VERSION)-next-$(COMMIT)-$(DATE)
endif
ifeq $(VERSION,)
VERSION := $(COMMIT)-$(DATA)
GOPATH=$HOME/go
GOBIN=$GOPATH/bin
PATH=$PATH:$GOBIN
source <(zpm load --install-missing --update-check)
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=#ff00ff"
@eugene-babichenko
eugene-babichenko / InfluxDB_Python_Example.ipynb
Last active January 30, 2019 08:12
An example of using Pandas and matplotlib (wrapped with Seaborn) along with the InfluxDB driver to analyze metrics.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@eugene-babichenko
eugene-babichenko / Makefile
Created November 8, 2018 15:01
Git hook to check Rust code formatting
init:
git config core.hooksPath .githooks
format:
cargo fmt -- --force --write-mode overwrite
# generated by `thefuck --alias`
source $HOME/thefuck.sh
source $HOME/antigen.zsh
antigen use oh-my-zsh
antigen bundle cargo
antigen bundle colored-man-pages
antigen bundle docker
" BASIC SETTINGS BEGIN
set backspace=indent,eol,start " backspace everything
set number " enable line numbering
set noerrorbells " disable beeps
set title " show the current filename in the window title
set cursorline " highlight current line
" remove underline
hi CursorLine cterm=none
set wildmenu " visual autocomplete for commands
@eugene-babichenko
eugene-babichenko / to_flac.sh
Created September 10, 2016 12:43
This is a simple script to convert all your M4A, or whatever you define, to FLAC. This script acts on audio files in the current folder and all subfolders.
find . -type f -iname "*.m4a" -print0 | while IFS= read -r -d $'\0' input_file; do ffmpeg -i "$input_file" -f flac "${input_file%.*}.flac" < /dev/null; rm "$input_file"; done
@eugene-babichenko
eugene-babichenko / CMakeLists.txt
Last active July 1, 2023 18:01
CMakeLists.txt and toolchain file for building STM32 HAL-based projects generated with STM32CubeMX with arm-none-eabi-gcc. STM32CubeMX settings. Toolchain: SW4STM32. ☑ Generate under root.
set(PRJ_NAME CLion_STM_LED)
set(MCU_FAMILY STM32F1xx)
set(MCU_LINE STM32F103xB)
set(MCU_LINKER_SCRIPT STM32F103RBTx_FLASH.ld)
cmake_minimum_required(VERSION 3.6)
project(${PRJ_NAME} C ASM)
add_definitions(-D${MCU_LINE})