Skip to content

Instantly share code, notes, and snippets.

@Noyabronok
Noyabronok / jdks.sh
Last active January 9, 2018 22:07
JDK switching
#list available jdks
alias jdks="/usr/libexec/java_home -V"
# jdk version switching - e.g. `jdk 6` will switch to version 1.6
function jdk() {
echo "Switching java version";
export JAVA_HOME=`/usr/libexec/java_home -v 1.$1`;
java -version;
}
export PATH=\$JAVA_HOME/jre/bin:$PATH
@Noyabronok
Noyabronok / gist:15f93580601917c1b8c0937233068c30
Created September 21, 2017 16:59
github expand outdated comments
$(".js-comment-container.outdated-comment").addClass("open")
@Noyabronok
Noyabronok / disable-address1-only.html
Created January 29, 2018 22:32
example of form where chrome autofill works for all fields except address1
<!DOCTYPE html>
<head>
<title>Some Site</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
</head>
<body>
<p>Some other website</p>
<form id="test-form" action="#" autocomplete="disabled">
First Name: <input type="text" name="fname" id="fname-id" autocomplete="given-name"><br/>
Last Name: <input type="text" name="lname" id="lname-id" autocomplete="family-name"><br/>
@Noyabronok
Noyabronok / bad-self-closing-tags-regex
Last active July 28, 2023 19:24
Improper Self closing tags regex vscode
<(?!(meta|link|br|input|hr|img))([^>]|\n)*\/>
@Noyabronok
Noyabronok / README-convert-properties-to-json-using-jq.md
Created June 4, 2024 22:41 — forked from drmalex07/README-convert-properties-to-json-using-jq.md
Convert properties to JSON using jq. #properties $json #jq

README

Say we have a properties file at foo.properties.

First, clean-up whitespace and empty lines, store in foo-1.properties:

cat foo.properties | \
    sed 's/[[:space:]]*=[[:space:]]*/=/' | \
    sed 's/[[:space:]]*$//' | \

sed '/^$/d' > foo-1.properties