Skip to content

Instantly share code, notes, and snippets.

View Gabri3l's full-sized avatar

Gabriele Cimato Gabri3l

View GitHub Profile
import tempfile
import json
from google.cloud import storage
def upload_from_temp_file(some_data):
with tempfile.NamedTemporaryFile() as fp:
json_data = json.dumps(some_data)
fp.write(json_data.encode())
fp.flush()
func BytesArrayToString(data []bytes) string {
bodyBytes, perr := ioutil.ReadAll(data)
if perr != nil {
fmt.Print("UH OH")
}
bodyString := string(bodyBytes)
return bodyString
}
async function handleRetry(
functionToRetry,
functionName,
operationId,
previousAttemptNumber,
...args
) {
try {
return functionToRetry(...args);
} catch (err) {