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 / git-commands.sh
Created January 4, 2021 15:35
Git commands
git diff-index --quiet HEAD -- || ( echo "Uncommitted changes" && exit 1 )
@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 / 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)
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 / README.md
Created February 2, 2019 14:07
SCRIPT-8
@ajermakovics
ajermakovics / README.md
Created February 2, 2019 13:43
SCRIPT-8
@ajermakovics
ajermakovics / README.md
Created February 2, 2019 13:43
SCRIPT-8
@ajermakovics
ajermakovics / README.md
Created February 2, 2019 13:30
SCRIPT-8
@ajermakovics
ajermakovics / keybindings.json
Created May 18, 2017 07:11
Visual Studio Code keyboard shortcuts remapped to IntelliJ IDEA shortcuts
// Place your key bindings in this file to overwrite the defaults
[
{
"key": "cmd+shift+o",
"command": "workbench.action.quickOpen"
},
{
"key": "cmd+o",
"command": "workbench.action.showAllSymbols"
},
@ajermakovics
ajermakovics / jvm-mon.rb
Created March 27, 2017 12:02 — forked from janhoy/jvm-mon.rb
jvm-mon brew formulae
# Documentation: http://docs.brew.sh/Formula-Cookbook.html
# http://www.rubydoc.info/github/Homebrew/brew/master/Formula
class JvmMon < Formula
desc "Console based JVM monitoring"
homepage "https://github.com/ajermakovics/jvm-mon"
url "https://github.com/ajermakovics/jvm-mon/releases/download/0.2/jvm-mon-0.2.tar.gz"
sha256 "3f85e8fec42449d8af831657ede96c9b7a5d12e80b35dbbc14f2e00eae301f28"
depends_on :java => "1.8+"