This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.grokhard.explorejavaconcurrency; | |
import static java.util.concurrent.TimeUnit.SECONDS; | |
import java.util.Objects; | |
import java.util.concurrent.locks.Lock; | |
import java.util.concurrent.locks.ReadWriteLock; | |
import java.util.concurrent.locks.ReentrantReadWriteLock; | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e -u -o pipefail | |
# Send, in sequential order, 10 requests and prints only the HTTP Status Code and the total time of the request | |
# with a Connnection Time Out in 5 seconds. | |
URL="$1" | |
{ | |
for _ in {1..10}; | |
do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -ueo pipefail | |
get_repo_id() { | |
local -r org="$1" | |
local -r repo_name="$2" | |
cat <<_PAYLOAD_ \ | |
| curl \ | |
--silent \ | |
--fail \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Source: https://stackoverflow.com/a/21738732/495558 | |
-- NOTE: This script is adjusted from the original: | |
-- - Added Indices' size. | |
-- - Limited only those whose size exceeding 100MiB. | |
select | |
schema_name, | |
relname, | |
pg_size_pretty(table_size) as size, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -u -e -o pipefail | |
git clone https://github.com/ramzes3333/feign-reactive | |
# Change version to 4.0.4.UNOFFICIAL | |
find feign-reactive -type f -name 'pom.xml' \ | |
-exec \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
#---------- | |
# back | |
# Goes back to parent directory quicker. | |
# | |
# NUMBER - goes back to x levels by repeatedly calling `cd ..`. | |
# SUBPATH - a segment of a full path to go back. | |
# | |
# *KNOWN LIMITS* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function replacerJSONStringify() { | |
if (window.__JSON_stringify_replaced__ === true) { | |
return; | |
} | |
const _originalStringify = JSON.stringify; | |
// NOTE: | |
// ---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.grokhard.exploring.java.mapstruct; | |
import static org.junit.jupiter.api.Assertions.assertEquals; | |
import org.junit.jupiter.api.Test; | |
import org.mapstruct.BeanMapping; | |
import org.mapstruct.Mapper; | |
import org.mapstruct.MappingTarget; | |
import org.mapstruct.NullValueCheckStrategy; | |
import org.mapstruct.NullValuePropertyMappingStrategy; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssh-keygen -o -t ed25519 -f private-key-ed25519.pem -N '' -C "Some comment" <<<y 2>&1 >/dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -u -e -o pipefail | |
# INTRODUCTION | |
# --- | |
# | |
# This snippet it aggregrate the `size` of all repositories in an GitHub Orginazation | |
# to report the total used storage (approximately). | |
# | |
# PREREQUISITES |
NewerOlder