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
brew list --installed-on-request |
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
# syntax | |
# gh repo view <repo> --json createdAt | |
# example | |
gh repo view measure-sh/measure --json createdAt |
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
-------------- | |
-- query cache | |
-------------- | |
-- see full details of query cache entries | |
SELECT | |
substring(query, 1, 30), | |
result_size, | |
tag, | |
stale, |
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
# syntax - assuming a `docker-compose.yml` file is present at $(PWD) | |
docker compose logs --no-log-prefix -f <compose-service-name> | agrind '(*) AND NOT ("string-one" OR "string-two")' | |
# example | |
docker compose logs --no-log-prefix -f my-compose-service | agrind '(*) AND NOT ("ping" OR "traces export")' | |
# combine angle grinder with tailspin | |
docker compose logs --no-log-prefix -f my-compose-service | agrind '(*) AND NOT ("ping" OR "traces export")' | tspin -ce |
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
# Manipulating data by combining various modern terminal utilities like fd, dasel, rg and so on. | |
# Working with single files. Let's assume there is a `data.json` file with the following contents. | |
# [ | |
# { | |
# "id": "some-id-1", | |
# "attribute": { | |
# "some-key-1": "some-value-1", | |
# "some-key-2": "some-value-2", | |
# "some-key-3": "some-value-3" |
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
Backup: | |
docker exec -t -u postgres your-db-container pg_dumpall -c > dump_`date +%d-%m-%Y"_"%H_%M_%S`.sql | |
Restore: | |
cat your_dump.sql | docker exec -i your-db-container psql -Upostgres |
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 | |
# Syntax | |
# awk '{gsub("\\n", "\n"}; print' <file> | |
# Example | |
awk '{gsub("\\n", "\n"}; print' some-file.txt |
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
for i in (seq 1 10) | |
go test ./... | |
end |
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
# Adding a key/value pair to an object based on a condition | |
# | |
# Let's say you have a sample object like: | |
# | |
# ```json | |
# { | |
# "session_id": "some-id-1", | |
# "timestamp": "some-timestamp", | |
# "events": [ | |
# { |
NewerOlder