Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Andrejs Jermakovics ajermakovics

🎯
Focusing
View GitHub Profile
View git-commands.sh
git diff-index --quiet HEAD -- || ( echo "Uncommitted changes" && exit 1 )
@ajermakovics
ajermakovics / date-to-ts.sh
Created Jun 14, 2020
Date to timestamp (macOS)
View date-to-ts.sh
#!/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
Jackson ObjectMapper Config
View ObjectMapperConfig.java
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)
View .bashrc
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 / keybindings.json
Created May 18, 2017
Visual Studio Code keyboard shortcuts remapped to IntelliJ IDEA shortcuts
View keybindings.json
// 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 Mar 27, 2017 — forked from janhoy/jvm-mon.rb
jvm-mon brew formulae
View jvm-mon.rb
# 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+"