Permalink
Browse files

Format code blocks with triple backtick

  • Loading branch information...
pietern committed Jun 25, 2012
1 parent 2342c59 commit 66b17c2ab00ca9fa27b751c73a4d7ef05e740d09
Showing with 980 additions and 758 deletions.
  1. +15 −11 commands/append.md
  2. +6 −5 commands/bitcount.md
  3. +6 −5 commands/bitop.md
  4. +25 −17 commands/blpop.md
  5. +9 −7 commands/brpop.md
  6. +13 −9 commands/config get.md
  7. +4 −2 commands/config set.md
  8. +6 −5 commands/decr.md
  9. +4 −3 commands/decrby.md
  10. +5 −4 commands/del.md
  11. +4 −3 commands/dump.md
  12. +3 −2 commands/echo.md
  13. +101 −75 commands/eval.md
  14. +5 −4 commands/exists.md
  15. +13 −10 commands/expire.md
  16. +6 −5 commands/expireat.md
  17. +5 −4 commands/get.md
  18. +6 −5 commands/getbit.md
  19. +7 −6 commands/getrange.md
  20. +10 −8 commands/getset.md
  21. +5 −4 commands/hdel.md
  22. +5 −4 commands/hexists.md
  23. +5 −4 commands/hget.md
  24. +5 −4 commands/hgetall.md
  25. +6 −5 commands/hincrby.md
  26. +6 −5 commands/hincrbyfloat.md
  27. +5 −4 commands/hkeys.md
  28. +5 −4 commands/hlen.md
  29. +5 −4 commands/hmget.md
  30. +5 −4 commands/hmset.md
  31. +4 −3 commands/hset.md
  32. +5 −4 commands/hsetnx.md
  33. +5 −4 commands/hvals.md
  34. +54 −45 commands/incr.md
  35. +4 −3 commands/incrby.md
  36. +6 −5 commands/incrbyfloat.md
  37. +14 −12 commands/info.md
  38. +6 −5 commands/keys.md
  39. +7 −6 commands/lindex.md
  40. +6 −5 commands/linsert.md
  41. +5 −4 commands/llen.md
  42. +7 −6 commands/lpop.md
  43. +5 −4 commands/lpush.md
  44. +7 −6 commands/lpushx.md
  45. +9 −8 commands/lrange.md
  46. +8 −7 commands/lrem.md
  47. +8 −7 commands/lset.md
  48. +11 −8 commands/ltrim.md
  49. +5 −4 commands/mget.md
  50. +42 −34 commands/monitor.md
  51. +5 −4 commands/mset.md
  52. +5 −4 commands/msetnx.md
  53. +22 −18 commands/object.md
  54. +7 −6 commands/persist.md
  55. +6 −5 commands/pexpire.md
  56. +6 −5 commands/pexpireat.md
  57. +3 −2 commands/ping.md
  58. +5 −4 commands/psetex.md
  59. +5 −4 commands/pttl.md
  60. +5 −4 commands/rename.md
  61. +6 −5 commands/renamenx.md
  62. +14 −12 commands/restore.md
  63. +7 −6 commands/rpop.md
  64. +8 −7 commands/rpoplpush.md
  65. +5 −4 commands/rpush.md
  66. +7 −6 commands/rpushx.md
  67. +6 −5 commands/sadd.md
  68. +5 −4 commands/scard.md
  69. +4 −3 commands/script exists.md
  70. +15 −12 commands/sdiff.md
  71. +4 −3 commands/set.md
  72. +5 −4 commands/setbit.md
  73. +9 −6 commands/setex.md
  74. +11 −6 commands/setnx.md
  75. +9 −7 commands/setrange.md
  76. +15 −12 commands/sinter.md
  77. +5 −4 commands/sismember.md
  78. +13 −11 commands/slowlog.md
  79. +5 −4 commands/smembers.md
  80. +8 −7 commands/smove.md
  81. +33 −11 commands/sort.md
  82. +7 −6 commands/spop.md
  83. +6 −5 commands/srandmember.md
  84. +8 −7 commands/srem.md
  85. +5 −4 commands/strlen.md
  86. +15 −12 commands/sunion.md
  87. +4 −3 commands/time.md
  88. +5 −4 commands/ttl.md
  89. +8 −7 commands/type.md
  90. +7 −6 commands/zadd.md
  91. +5 −4 commands/zcard.md
  92. +7 −6 commands/zcount.md
  93. +6 −5 commands/zincrby.md
  94. +9 −8 commands/zinterstore.md
  95. +8 −7 commands/zrange.md
  96. +15 −10 commands/zrangebyscore.md
  97. +7 −6 commands/zrank.md
  98. +7 −6 commands/zrem.md
  99. +7 −6 commands/zremrangebyrank.md
  100. +7 −6 commands/zremrangebyscore.md
  101. +8 −7 commands/zrevrange.md
  102. +9 −8 commands/zrevrangebyscore.md
  103. +7 −6 commands/zrevrank.md
  104. +4 −3 commands/zscore.md
  105. +9 −8 commands/zunionstore.md
  106. +14 −1 remarkdown.rb
View
@@ -9,19 +9,22 @@ will be similar to `SET` in this special case.
@examples
- @cli
- EXISTS mykey
- APPEND mykey "Hello"
- APPEND mykey " World"
- GET mykey
+```cli
+EXISTS mykey
+APPEND mykey "Hello"
+APPEND mykey " World"
+GET mykey
+```
## Pattern: Time series
the `APPEND` command can be used to create a very compact representation of a
list of fixed-size samples, usually referred as _time series_.
Every time a new sample arrives we can store it using the command
- APPEND timeseries "fixed-size sample"
+```
+APPEND timeseries "fixed-size sample"
+```
Accessing individual elements in the time series is not hard:
@@ -45,8 +48,9 @@ more friendly to be distributed across many Redis instances.
An example sampling the temperature of a sensor using fixed-size strings (using
a binary format is better in real implementations).
- @cli
- APPEND ts "0043"
- APPEND ts "0035"
- GETRANGE ts 0 3
- GETRANGE ts 4 7
+```cli
+APPEND ts "0043"
+APPEND ts "0035"
+GETRANGE ts 0 3
+GETRANGE ts 4 7
+```
View
@@ -18,11 +18,12 @@ The number of bits set to 1.
@examples
- @cli
- SET mykey "foobar"
- BITCOUNT mykey
- BITCOUNT mykey 0 0
- BITCOUNT mykey 1 1
+```cli
+SET mykey "foobar"
+BITCOUNT mykey
+BITCOUNT mykey 0 0
+BITCOUNT mykey 1 1
+```
## Pattern: real time metrics using bitmaps
View
@@ -32,11 +32,12 @@ size of the longest input string.
@examples
- @cli
- SET key1 "foobar"
- SET key2 "abcdef"
- BITOP AND dest key1 key2
- GET dest
+```cli
+SET key1 "foobar"
+SET key2 "abcdef"
+BITOP AND dest key1 key2
+GET dest
+```
## Pattern: real time metrics using bitmaps
View
@@ -15,7 +15,9 @@ Let's say that the key `list1` doesn't exist and `list2` and `list3` hold
non-empty lists.
Consider the following command:
- BLPOP list1 list2 list3 0
+```
+BLPOP list1 list2 list3 0
+```
`BLPOP` guarantees to return an element from the list stored at `list2` (since
it is the first non empty list when checking `list1`, `list2` and `list3` in
@@ -69,13 +71,15 @@ If you like science fiction, think of time flowing at infinite speed inside a
@examples
- redis> DEL list1 list2
- (integer) 0
- redis> RPUSH list1 a b c
- (integer) 3
- redis> BLPOP list1 list2 0
- 1) "list1"
- 2) "a"
+```
+redis> DEL list1 list2
+(integer) 0
+redis> RPUSH list1 a b c
+(integer) 3
+redis> BLPOP list1 list2 0
+1) "list1"
+2) "a"
+```
## Pattern: Event notification
@@ -89,16 +93,20 @@ blocking list operations we can easily accomplish this task.
The consumer will do:
- LOOP forever
- WHILE SPOP(key) returns elements
- ... process elements ...
- END
- BRPOP helper_key
+```
+LOOP forever
+ WHILE SPOP(key) returns elements
+ ... process elements ...
END
+ BRPOP helper_key
+END
+```
While in the producer side we'll use simply:
- MULTI
- SADD key element
- LPUSH helper_key x
- EXEC
+```
+MULTI
+SADD key element
+LPUSH helper_key x
+EXEC
+```
View
@@ -21,10 +21,12 @@ the tail of a list instead of popping from the head.
@examples
- redis> DEL list1 list2
- (integer) 0
- redis> RPUSH list1 a b c
- (integer) 3
- redis> BRPOP list1 list2 0
- 1) "list1"
- 2) "c"
+```
+redis> DEL list1 list2
+(integer) 0
+redis> RPUSH list1 a b c
+(integer) 3
+redis> BRPOP list1 list2 0
+1) "list1"
+2) "c"
+```
View
@@ -11,13 +11,15 @@ All the configuration parameters matching this parameter are reported as a list
of key-value pairs.
Example:
- redis> config get *max-*-entries*
- 1) "hash-max-zipmap-entries"
- 2) "512"
- 3) "list-max-ziplist-entries"
- 4) "512"
- 5) "set-max-intset-entries"
- 6) "512"
+```
+redis> config get *max-*-entries*
+1) "hash-max-zipmap-entries"
+2) "512"
+3) "list-max-ziplist-entries"
+4) "512"
+5) "set-max-intset-entries"
+6) "512"
+```
You can obtain a list of all the supported configuration parameters by typing
`CONFIG GET *` in an open `redis-cli` prompt.
@@ -37,8 +39,10 @@ following important differences:
For instance what in `redis.conf` looks like:
- save 900 1
- save 300 10
+```
+save 900 1
+save 300 10
+```
that means, save after 900 seconds if there is at least 1 change to the dataset,
and after 300 seconds if there are at least 10 changes to the datasets, will be
View
@@ -25,8 +25,10 @@ following important differences:
For instance what in `redis.conf` looks like:
- save 900 1
- save 300 10
+```
+save 900 1
+save 300 10
+```
that means, save after 900 seconds if there is at least 1 change to the dataset,
and after 300 seconds if there are at least 10 changes to the datasets, should
View
@@ -12,8 +12,9 @@ See `INCR` for extra information on increment/decrement operations.
@examples
- @cli
- SET mykey "10"
- DECR mykey
- SET mykey "234293482390480948029348230948"
- DECR mykey
+```cli
+SET mykey "10"
+DECR mykey
+SET mykey "234293482390480948029348230948"
+DECR mykey
+```
View
@@ -12,6 +12,7 @@ See `INCR` for extra information on increment/decrement operations.
@examples
- @cli
- SET mykey "10"
- DECRBY mykey 5
+```cli
+SET mykey "10"
+DECRBY mykey 5
+```
View
@@ -7,7 +7,8 @@ A key is ignored if it does not exist.
@examples
- @cli
- SET key1 "Hello"
- SET key2 "World"
- DEL key1 key2 key3
+```cli
+SET key1 "Hello"
+SET key2 "World"
+DEL key1 key2 key3
+```
View
@@ -27,6 +27,7 @@ If `key` does not exist a nil bulk reply is returned.
@examples
- @cli
- SET mykey 10
- DUMP mykey
+```cli
+SET mykey 10
+DUMP mykey
+```
View
@@ -6,5 +6,6 @@ Returns `message`.
@examples
- @cli
- ECHO "Hello World!"
+```cli
+ECHO "Hello World!"
+```
Oops, something went wrong.

0 comments on commit 66b17c2

Please sign in to comment.