Skip to content

Instantly share code, notes, and snippets.

View stolarczyk's full-sized avatar

Michal Stolarczyk stolarczyk

View GitHub Profile
@chris-hailstorm
chris-hailstorm / gist:4989643
Last active December 31, 2021 19:21
Unicode to ASCII / UTF-8 converter for Python dicts, lists, strings and nested combinations of dicts, lists and strings
def asciify(data):
"""
SYNOPSIS
Asciifies strings, lists and dicts, and nested versions of same
DESCRIPTION
The JSON spec (http://www.ietf.org/rfc/rfc4627.txt) -- "JSON text SHALL
be encoded in Unicode". For apps that don't use unicode, this function
walks through all levels of a JSON data structure and converts each item
to ASCII. See http://stackoverflow.com/questions/956867/ for original.
@blaketmiller
blaketmiller / yaml2dir.py
Last active May 27, 2019 12:31
represent YAML as a directory
#!/usr/bin/env python
import os
import sys
import yaml
def dict_to_dir(data, path=str()):
"""dict_to_dir expects data to be a dictionary with one top-level key."""
# search replace AWS_ACCOUNT_ID with your AWS account ID and adjust the variables below (line 3-7), especially your API key
# if your flow needs access to other AWS resources other than S3, add those in the task role policy: line 96-108
export AWS_REGION=us-east-1
export ECS_CLUSTER_NAME=prefectEcsCluster
export ECS_LOG_GROUP_NAME=/ecs/prefectEcsAgent
export ECS_SERVICE_NAME=prefectECSAgent
export PREFECT_API_KEY=your_Prefect_Cloud_API_key
export AWS_PAGER=""
aws ssm put-parameter --type SecureString --name PREFECT__CLOUD__API_KEY --value $PREFECT_API_KEY --region $AWS_REGION --overwrite
@stolarczyk
stolarczyk / README.md
Last active June 26, 2024 20:04
Save GitHub issues as TSV

Save GitHub issues as TSV

This script saves GitHub issues in TSV format

Installation

The script has two software dependancies:

  1. GitHub CLI for querying GitHub API
  2. jq for transforming the output of the above to TSV format