Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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_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 / 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 / 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 / 99-misc
Last active August 29, 2015 14:19
Redis commands evolution
# get Redis' repo tags and their dates
git log --tags --simplify-by-decoration --pretty="format:%ct %d" | awk 'BEGIN { print "timestamp, tag" } /.*\(.*\)/ { print $1 ", " substr($3, 0, length($3)-1) }' > tags.csv
git log --tags --simplify-by-decoration --pretty="format:%ct %d" | awk 'BEGIN { print "{ \"releases\": [" } /.*\(.*\)/ { print " { \"timestamp\": " $1 ", \"name\": \"" substr($3, 0, length($3)-1) "\" }," } END { print " { \"timestamp\": 0, \"name\": \"the-big-bang\" }"; print "]}" }' > tags.json
@itamarhaber
itamarhaber / main.py
Created February 18, 2015 03:42
Benchmark different pre-ordered sorted sets insertion times to win the bounty at http://stackoverflow.com/questions/28499034/most-efficient-way-to-insert-an-already-sorted-set-into-redis
import redis
import random
import timeit
key = 'so_bounty'
number = 100
sample = 10000
r = redis.Redis()
@itamarhaber
itamarhaber / redis-watch-trivia-archive.md
Last active March 25, 2025 19:52
Redis Watch Trivia "Facts" - a Meta Archive

Redis Watch Trivia "Facts"

a Meta Archive

Look for a new #RedisTrivia fact every Thursday with your Redis Watch newsletter :)

Lifted with permission from the Redis Watch Archive: https://redislabs.com/redis-watch-archive

  1. Redis stands for REmote DIctionary Server
  2. everybody knows that Redis' default port is 6379, but have you ever wondered why? The answer is that 6379 spells MERZ on the phone's keypad (want to know what MERZ is? Read the appendix at http://oldblog.antirez.com/post/redis-as-LRU-cache.html [warning: slightly NSFW links inside])
javascript:{function replaceTokens(e,t){var n=e;for(var r in t){n=n.replace(RegExp("[$]"+r,"g"),t[r])}return n}function copyTweetForOverheard(){var e=$(".js-original-tweet");var t={fullname:$(".fullname.js-action-profile-name.show-popup-with-id",e).text(),username:$(".username",e).text(),text:$(".tweet-text",e).text(),url:window.location.href};var n='\t\t\t\t<p style="margin-top: 8px; margin-bottom: 36px;"><strong style="color: rgb(42, 130, 223); text-decoration: none;"><a href="$url" style="color: rgb(42, 130, 223); text-decoration: none;" target="_blank">$fullname $username:</a></strong>&nbsp;&quot;$text&quot;</p>';alert(replaceTokens(n,t))}copyTweetForOverheard()}