I hereby claim:
- I am cwells on github.
- I am cliffwells (https://keybase.io/cliffwells) on keybase.
- I have a public key ASCNReFgwc-v0DTQ-_2gwf_br_YI8ZDQ9NxtqopyYHvfJAo
To claim this, I am signing this object:
def dig(d, keys, *args): | |
"""Locate a value in a nested dictionary. | |
Args: | |
d (dict): the dictionary | |
keys (list): list of keys to index the dictionary with | |
default (value|callable): value or callable to return in case of missing key | |
Returns: | |
Value at `d[k0][k1][...]` if all keys are present |
#!/bin/env python3 | |
# | |
# Create ~/.aws/aws-mfa.yaml with the following content: | |
# | |
# --- | |
# default: | |
# account: 1234567890 | |
# username: [email protected] | |
# aws_profile: production |
include("./strings.jl") | |
filename, stride, highest = ARGS | |
@time main(filename, parse(Int64, stride), parse(Int64, highest)) |
import collections | |
def deep_fn_merge(fn, left, right): | |
for k, v in right.iteritems(): | |
if k in left and isinstance(left[k], dict) and isinstance(right[k], collections.Mapping): | |
deep_fn_merge(fn, left[k], right[k]) | |
else: | |
left[k] = fn(left, right, k) | |
def sum(left, right, key): |
import functools | |
def async_compat(func): | |
@functools.wraps(func) | |
def wrapper_decorator(*args, **kwargs): | |
version = sys.version_info[0] + sys.version_info[1] / 10.0 | |
if version >= 3.7: | |
kwargs['is_async'] = kwargs.get('async', False) | |
del kwargs['async'] | |
return func(*args, **kwargs) |
#!/usr/bin/env python3 | |
SKYHOOK_SDK_KEY = '<your skyhook sdk key>' | |
SKYHOOK_URL = 'https://global.skyhookwireless.com/wps2/location' | |
UUID = '<generate using uuidgen>' | |
import time | |
import webbrowser | |
import gi | |
gi.require_version('NM', '1.0') |
#!/usr/bin/env python3 | |
import dbus | |
from dbus.mainloop.glib import DBusGMainLoop | |
from gi.repository import GLib | |
GEOCLUE = 'org.freedesktop.GeoClue2' | |
DBUS_PROPERTIES = 'org.freedesktop.DBus.Properties' | |
GCLUE_ACCURACY_LEVEL_COUNTRY = dbus.UInt32(1) |
def scale(x, a, b): | |
# translate x from scale(a) -> scale(b) | |
(a_min, a_max), (b_min, b_max) = a, b | |
return ((b_max - b_min) * (x - a_min)) / (a_max - a_min) + b_min |
I hereby claim:
To claim this, I am signing this object:
#!/bin/env python | |
import json | |
import time | |
from collections import ChainMap | |
from functools import partial | |
import click | |
from taskgraph import TaskGraph |