Installer avec Codex ou Claude Copiez ce prompt, collez-le dans Codex, Claude ou un autre assistant, puis laissez-le vérifier la page du skill et l'installer pour vous.
Une commande directe contourne le prompt de vérification. Examinez la source avant de l'exécuter.
Memory-efficient bit operations for flags and counters. 512MB max = 2^32 bits.
Bitmap Commands
SETBIT key offset value # Set bit - O(1)
GETBIT key offset # Get bit - O(1)
BITCOUNT key [start end [BYTE|BIT]] # Count 1s - O(N)
BITOP AND|OR|XOR|NOT destkey key [key ...] # Bitwise ops - O(N)
BITPOS key bit [start [end [BYTE|BIT]]] # Find position - O(N)
BITFIELD key [GET type offset] [SET type offset value] [INCRBY type offset increment]
Pattern 1: User Activity Tracking
# Track daily logins (1 bit per day)
SETBIT user:123:logins:2024 0 1 # Jan 1
SETBIT user:123:logins:2024 4 1 # Jan 5
SETBIT user:123:logins:2024 9 1 # Jan 10
# Count login days in January
BITCOUNT user:123:logins:2024 0 3 # First 4 bytes = 31 days
# Check specific day
GETBIT user:123:logins:2024 4 # Returns 1
# Track DAU with bitmap
SETBIT dau:2024-01-15 123 1 # User 123 active
SETBIT dau:2024-01-15 456 1 # User 456 active
# Count DAU
BITCOUNT dau:2024-01-15
# Weekly active (OR across days)
BITOP OR wau:2024-w3 dau:2024-01-15 dau:2024-01-16 dau:2024-01-17
BITCOUNT wau:2024-w3
# Users active all 7 days (AND)
BITOP AND daily-active:week dau:2024-01-15 dau:2024-01-16 ...
HyperLogLog
Probabilistic cardinality estimation with 0.81% standard error. Only 12KB per key!
Location-based data with distance and radius queries.
Geo Commands
GEOADD key [NX|XX] [CH] longitude latitude member [longitude latitude member ...]
GEOPOS key member [member ...]
GEODIST key member1 member2 [M|KM|FT|MI]
GEOHASH key member [member ...]
GEOSEARCH key FROMMEMBER member|FROMLONLAT lon lat BYRADIUS radius M|KM|FT|MI|BYBOX width height M|KM|FT|MI [ASC|DESC] [COUNT count [ANY]] [WITHCOORD] [WITHDIST] [WITHHASH]
GEOSEARCHSTORE dest src FROMMEMBER member|FROMLONLAT lon lat BYRADIUS radius unit|BYBOX width height unit [ASC|DESC] [COUNT count [ANY]] [STOREDIST]
Pattern 1: Store Locator
# Add store locations
GEOADD stores -122.4194 37.7749 "store:sf"
GEOADD stores -118.2437 34.0522 "store:la"
GEOADD stores -73.9857 40.7484 "store:nyc"
# Find stores within 50km
GEOSEARCH stores FROMLONLAT -122.4 37.8 BYRADIUS 50 km WITHCOORD WITHDIST
# Distance between stores
GEODIST stores "store:sf" "store:la" km # ~559 km
Pattern 2: Nearby Users
# Update user location
GEOADD users:location -122.4194 37.7749 "user:123"
# Find nearby users
GEOSEARCH users:location FROMMEMBER "user:123" BYRADIUS 5 km COUNT 10 WITHDIST
# Store results for caching
GEOSEARCHSTORE nearby:user:123 users:location FROMMEMBER "user:123" BYRADIUS 5 km
Pattern 3: Delivery Zone Check
# Define delivery zones (store + radius)
GEOADD zones -122.4194 37.7749 "zone:downtown"
# Check if address in delivery zone
GEODIST zones "zone:downtown" "customer:addr" km
# If < 10, can deliver