Skip to content

Instantly share code, notes, and snippets.

@itamarhaber
itamarhaber / butt-emoticons.md
Last active August 29, 2015 14:19
Butt Emoticons

Butt Emoticons

(!)     the basic one
(_!_)   the fuller one
(.)     the flat one
(:)     the one plus one, a.k.a colons
(8)     the too weird one
(,)     the caught in the act one
(;) the 60FPS one
@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"
@itamarhaber
itamarhaber / 00_benchmarking-theorem.png
Last active August 29, 2015 14:20
Haber's Benchmarking Theorem (as postulated for Ask a Redis Expert™ Webinar: How to Achieve 1.5M ops/sec with Redis, https://www.youtube.com/watch?v=yS-Z9JnkWsA)
00_benchmarking-theorem.png
@itamarhaber
itamarhaber / external-references.md
Created May 13, 2015 14:03
20150513 Ask a Redis Expert Webinar - How to achieve 1.5M ops sec with Redis
@itamarhaber
itamarhaber / 00_Redis_Watch_44.NFO
Last active August 29, 2015 14:21
Lost in translation - Redis Watch #44
ii ii ii ii
ii ii ii ii
ii ii ii
i ii ii ii ii i ii iii ii iiii ii ii ii
iiiiii iiiiii iiiiiiii ii iiiiii ii ii iiiiiiiiiiiiii iiiiii iiiiiii
iiiiiiiiiiiiii iiiiiiiii ii iiiiii ii i ii iiiiiiii iiii iiiiiii iiiiiiii
iii iii ii iii iii ii ii i iii ii iiiiii iii ii iii iii iii
iii iiiiiiiii ii ii ii iiiii ii iiii ii ii ii ii iii ii ii
ii iiiiiiiii ii ii ii iiiii iiiiiiiiii ii ii ii ii ii ii
ii iii ii iii ii iii iiiiiiiii iii iii ii iii ii ii
@itamarhaber
itamarhaber / urls.md
Last active August 29, 2015 14:22
Redis & MongoDB Stop Big Data Indigestion Before It Starts
  1. Redis Watch - a weekly newsletter about everything Redis: http://bit.ly/RedisWatch
  2. WiredTiger iiBench Results: https://github.com/wiredtiger/wiredtiger/wiki/iiBench-results
  3. Redis Website: https://redis.io/
  4. Redis repository: https://github.com/antirez/redis
  5. Antirez's blog: http://antirez.com/
  6. Recorded webinar - How to Achieve 1.5M ops/sec with Redis: https://www.youtube.com/watch?v=yS-Z9JnkWsA
  7. Try Redis: http://try.redis.io/
  8. Download Redis Labs Enterprise Cluster: https://redislabs.com/redis-enterprise-downloads
  9. Redis Clients page: http://redis.io/clients
@itamarhaber
itamarhaber / redis rdb ttl
Created July 23, 2015 11:57
What happens to volatile keys when loading from RDB in Redis?
foo@bar:~$ redis-cli
127.0.0.1:6379> flushall
OK
127.0.0.1:6379> save
OK
127.0.0.1:6379> set p persistent
OK
127.0.0.1:6379> set v volatile
OK
127.0.0.1:6379> expire v 99999999
@itamarhaber
itamarhaber / absttl.lua
Created August 5, 2015 21:29
Redis absolute TTL (accuracy +/- 1 second)
-- Returns a key's absolute TTL
local t = tonumber(redis.call('TTL', KEYS[1]))
if t > 0 then
t = t + tonumber(redis.call('TIME')[1])
end
return t
@itamarhaber
itamarhaber / 10-redis-commandments.md
Last active September 25, 2015 08:49
Ten Redis Commandments

creative

"Went up the mountain, spent some time there, a bush or something was burning and I must have inhaled the smoke because I came back down carrying these two slabs of stone...", HippieLogLog

Ten Redis Commandments

I. I am thy open source, BSD licensed, data structure store

II. Thou shalt have no other data but that which fits in RAM

@itamarhaber
itamarhaber / external-references.md
Last active August 13, 2020 19:21
20150903 Ask a Redis Expert Webinar - Why Your MongoDBNeeds Redis