Skip to content

Instantly share code, notes, and snippets.

@lanre-ade
lanre-ade / listS3.go
Last active December 21, 2017 19:03
Concurrently list items in large s3 bucket/path with millions of objects
package main
import (
"bytes"
"flag"
"fmt"
"log"
"os"
"regexp"
"strconv"
@lanre-ade
lanre-ade / _get_value.py
Last active August 22, 2017 19:35
given an array keys and a dictionary, recursively navigate down the dictionary to fetch value
# given an array keys and a dictionary, recursively navigate down the dictionary to fetch value
def _get_value(dict, keys=[], default=None):
"""
_get_value({"k":{"k1":"v1"}}, ["k", "k1"]) == "v1"
"""
if not keys:
return default
elif len(keys) == 1:
return dict.get(keys[0], default)
else: