jq 'map(.foo)'
[ { foo: 1 }, { foo: 2 } ]
[1, 2]
| #!/usr/bin/env python | |
| import argparse | |
| import redis | |
| def connect_redis(conn_dict): | |
| conn = redis.StrictRedis(host=conn_dict['host'], | |
| port=conn_dict['port'], | |
| db=conn_dict['db']) | |
| return conn |
| # Key derivation functions. See: | |
| # http://docs.aws.amazon.com/general/latest/gr/signature-v4-examples.html#signature-v4-examples-python | |
| def sign(key, msg): | |
| return hmac.new(key, msg.encode('utf-8'), hashlib.sha256).digest() | |
| def getSignatureKey(key, dateStamp, regionName, serviceName): | |
| kDate = sign(('AWS4' + key).encode('utf-8'), dateStamp) | |
| kRegion = sign(kDate, regionName) | |
| kService = sign(kRegion, serviceName) |
| import Data.Char | |
| positions :: Eq a => a -> [a] -> [Int] | |
| positions x xs = [i | (x', i) <- zip xs [0..], x==x'] | |
| lowers :: String -> Int | |
| lowers xs = length [x | x <- xs, x >= 'a' && x <= 'z'] | |
| count :: Char -> String -> Int | |
| count x xs = length [x' | x' <- xs, x == x'] |
| #============================================================================= | |
| # dark_powered.toml --- dark powered configuration example for SpaceVim | |
| # Copyright (c) 2016-2017 Wang Shidong & Contributors | |
| # Author: Wang Shidong < wsdjeg at 163.com > | |
| # URL: https://spacevim.org | |
| # License: GPLv3 | |
| #============================================================================= | |
| [options] | |
| lint_on_the_fly = true |