gcloud builds submit \
--config=cloudbuild-java.yaml \
--substitutions=_APACHE_BEAM_VERSION="2.22.0",_PIPELINE_WAIT_UNTIL_FINISH=false
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 | |
# Make GITHUB_REF safe for use as docker tag | |
# | |
# Examples: | |
# $ ./tag_from_ref.sh "refs/pull/2/merge" # -> 'pr-2' | |
# $ ./tag_from_ref.sh "refs/heads/master" # -> 'master' | |
# $ ./tag_from_ref.sh "refs/heads/feature/branch" # -> 'feature-branch' | |
# $ ./tag_from_ref.sh "refs/heads/releases/v1" # -> 'releases-v1' | |
# $ ./tag_from_ref.sh "refs/tags/v1.2.3" # -> 'v1.2.3' |
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
""" | |
Snippet from: | |
https://wrongsideofmemphis.com/2022/02/17/futures-and-easy-parallelisation/ | |
""" | |
import time | |
from concurrent.futures import ThreadPoolExecutor | |
import requests | |
from urllib.parse import urljoin |
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 | |
# https://betterdev.blog/minimal-safe-bash-script-template/ | |
set -Eeuo pipefail | |
trap cleanup SIGINT SIGTERM ERR EXIT | |
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P) | |
usage() { | |
cat <<EOF |
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
""" | |
Translate nested json to flattened csv | |
""" | |
import argparse | |
import csv | |
import json | |
from typing import Any, Tuple, Optional | |
def parse_args() -> Tuple[str, str, dict]: |
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
import os | |
import re | |
from atlassian import Jira | |
# comment to be parsed: | |
# // TODO: Java core test failing on windows, JIRA HERE ##io.LocalResourceIdTest.testResolveInWindowsOS## | |
USERNAME = os.environ["USERNAME"] | |
PASSWORD = os.environ["PASSWORD"] |
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://stackoverflow.com/questions/3589311/get-defining-class-of-unbound-method-object-in-python-3/25959545#25959545 | |
def get_class_that_defined_method(meth): | |
if inspect.ismethod(meth): | |
for cls in inspect.getmro(meth.__self__.__class__): | |
if cls.__dict__.get(meth.__name__) is meth: | |
return cls | |
if inspect.isfunction(meth): | |
return getattr(inspect.getmodule(meth), | |
meth.__qualname__.split('.<locals>', 1)[0].rsplit('.', 1)[0]) |
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 python3 | |
""" | |
you can run this script on your Raspberry Pi by running the following command: | |
curl -sSL https://gist.githubusercontent.com/TobKed/75337ec7b73a0ac59a415b837927e4ee/raw/docker_on_raspbian.py | python3 | |
""" | |
import subprocess | |
def run(s): | |
subprocess.run(s, check=True, shell=True) |
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 python2.7 | |
# source: https://stackoverflow.com/a/20365264/9951157 | |
import datetime | |
import requests.adapters | |
import grequests | |
import gevent | |
__CONCURRENT_LIMIT__ = 80 | |
DEFAULT_BURST_WINDOW = datetime.timedelta(seconds=5) |
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://youtu.be/Jd8ulMb6_ls | |
# Larry Hastings - Solve Your Problem With Sloppy Python - PyCon 2018 | |
import subprocess | |
def run(s): | |
subprocess.run(s, check=True, shell=True) |
NewerOlder