Skip to content

Instantly share code, notes, and snippets.

View ajermakovics's full-sized avatar
🎯
Focusing

Andrejs Jermakovics ajermakovics

🎯
Focusing
View GitHub Profile
@ajermakovics
ajermakovics / README.md
Created February 2, 2019 13:43
SCRIPT-8
@ajermakovics
ajermakovics / README.md
Created February 2, 2019 14:07
SCRIPT-8
PS1="\W\$ " # working dir
if [[ $EUID -eq 0 ]]; then # root user
PS1="\W\e[1;31m\]\$ \e[0m" # show '$' in red
fi
export PS1
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced
@ajermakovics
ajermakovics / ObjectMapperConfig.java
Created May 16, 2020 11:56
Jackson ObjectMapper Config
public final static ObjectMapper mapper = new ObjectMapper()
.findAndRegisterModules()
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false)
.configure(SerializationFeature.INDENT_OUTPUT, true)
.configure(Feature.ALLOW_COMMENTS, true)
.configure(Feature.ALLOW_SINGLE_QUOTES, true)
.configure(Feature.ALLOW_UNQUOTED_FIELD_NAMES, true)
.configure(Feature.ALLOW_YAML_COMMENTS, true)
.configure(Feature.ALLOW_UNQUOTED_CONTROL_CHARS, true)
@ajermakovics
ajermakovics / date-to-ts.sh
Created June 14, 2020 08:07
Date to timestamp (macOS)
#!/bin/bash
# Convert given date to timestamp
# Date format: YYYY-MM-DD (2020-02-28)
# If no argument given use current date
CURDATE=`date +%F`
DATE=${1:-$CURDATE}
echo "Arg/Cur: $DATE"
@ajermakovics
ajermakovics / git-commands.sh
Created January 4, 2021 15:35
Git commands
git diff-index --quiet HEAD -- || ( echo "Uncommitted changes" && exit 1 )