Skip to content

Instantly share code, notes, and snippets.

View puzzledvacuum's full-sized avatar

Peter Frescura puzzledvacuum

View GitHub Profile
@datashaman
datashaman / names.py
Last active March 10, 2023 08:23
Get names
strategies = [
{
'type': str,
'return': lambda input: [input.strip()] if input.strip() else [],
},
{
'type': dict,
'return': lambda input: [input.get('name')] if input.get('name') else [],
},
{
@itamarhaber
itamarhaber / Redis SCAN by "regex"
Last active May 21, 2019 13:24
Regex-like key name pattern matching in Redis
foo@bar:~$ redis-cli
127.0.0.1:6379> dbsize
(integer) 0
127.0.0.1:6379> set user:1 1
OK
127.0.0.1:6379> set use:the:force luke
OK
127.0.0.1:6379> set non:user a
OK
foo@bar:~$ redis-cli --eval scanregex.lua , "^user"