CF_TOKEN="..."
curl -X GET "https://api.cloudflare.com/client/v4/user/tokens/verify" \
-H "Authorization: Bearer $CF_TOKEN"
This file contains hidden or 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
| find . -name 'node_modules' -type d -not -path '*/node_modules/*/node_modules' -exec du -hs '{}' \; | |
| # alias find_node_modules="find . -name 'node_modules' -type d -not -path '*/node_modules/*/node_modules' -exec du -hs '{}' \;" | |
| # Same with dist, excludiong vendored thirdparty-js : | |
| # find . -name 'dist' -type d -not -path '*/thirdparty-js/*/dist' -exec du -hs '{}' \; | |
| # find . -name 'node_modules' -type d -not -path '*/node_modules/*/node_modules' -not -path '*/thirdparty-js/*/node_modules' -exec du -hs '{}' \; |
This file contains hidden or 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 -euo pipefail | |
| # https://www.jetbrains.com/help/idea/shared-indexes.html | |
| # USAGE: | |
| # idea.indexes.sh /path/to/project/dir | |
| CDN_ROOT="$HOME/_idea_cdn" | |
| mkdir -p "$CDN_ROOT" |
let i = 0,
spin = () => process.stdout.write(` ${[...'⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏'][i++ % 10]}\r`),
stop = (id => () => clearInterval(id))(setInterval(spin, 100));And I simply could not resist from sticking generator in it:
This file contains hidden or 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
| # https://github.com/siberex/snippets/blob/main/gcloud/appengine_deployer_role.sh | |
| #!/usr/bin/env bash | |
| # Usage: _setup_gcloud.sh [PROJECT_ID] | |
| set -euo pipefail | |
| BASEDIR="$( | |
| cd "$(dirname "$0")" || true |
let input = await fetch('https://adventofcode.com/2019/day/1/input').then(r => r.text());
input = input.split('\n').filter(Boolean);
// Part 1input = input.split('\n').map(v => parseInt(v));
for (let i = 0; i < input.length; i++) {
const a = input[i];
for (let j = i + 1; j < input.length; j++) {
This file contains hidden or 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
| # 3.8+ | |
| # https://docs.bazel.build/versions/master/platforms.html#skipping-incompatible-targets | |
| # https://docs.bazel.build/versions/master/be/common-definitions.html#common-attributes | |
| # Pre 3.8: | |
| # | |
| # Bazel Platforms Cookbook: | |
| # https://docs.google.com/document/d/1UZaVcL08wePB41ATZHcxQV4Pu1YfA1RvvWm8FbZHuW8/edit# | |
| # | |
| # Use this only for simple cases like skipping Windows-only targets on Linux CI. |
This file contains hidden or 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
| # App Engine: List all project regions and mapped domains | |
| # Effectively: | |
| # gcloud projects list --format 'get(PROJECT_ID)' | |
| # gcloud app describe --project "$projectId" --format 'get(locationId)' | |
| # gcloud app domain-mappings list --project "$projectId" --format 'get(ID)' | xargs | sed 's/ /, /g' | |
| printf "%s\t%s\t%s\n" "ProjectId" "Region" "Domains" | |
| gcloud projects list --format 'get(PROJECT_ID)' | while read -r projectId; do | |
| region=$(gcloud app describe --project "$projectId" --format 'get(locationId)' 2>/dev/null || echo 'N/A') |
This file contains hidden or 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 -euo pipefail | |
| # For a set of provided URLs, measure average response time for each one. | |
| # https://gist.github.com/siberex/9adb939b1c7872404672697ee7985188 | |
| NUM_REQUESTS=100 | |
| URLS=() |