Skip to content

Instantly share code, notes, and snippets.

@jhsu
Created March 17, 2011 22:10
Show Gist options
  • Save jhsu/875236 to your computer and use it in GitHub Desktop.
Save jhsu/875236 to your computer and use it in GitHub Desktop.

redis @qrush

smart cache, job queues, high speed analytics

binary ops (2.2+)

> touch normal.txt
> stat -f "%Sp" normal.txt

stat = File.stat("normal.txt")
mode = sprintf("%b", stat.mode)
bits = mode.scan(/\d/)

set algebra

something = [["something", 0], ["another", 2]]
Hash[*something]

sorting

redis.sort("user_ids", by: "blah_", get: "handle_")

transactions

-pub/sub -

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment