• Stars
    star
    5
  • Rank 2,774,909 (Top 57 %)
  • Language
    Crystal
  • License
    MIT License
  • Created about 8 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Set algebra solver for Redis

Stal

Set algebra solver for Redis

CI

Description

Stal receives an array with an s-expression composed of commands and key names and resolves the set operations in Redis.

Community

Meet us on IRC: #lesscode on freenode.net.

Getting started

Install Redis. On most platforms it's as easy as grabbing the sources, running make and then putting the redis-server binary in the PATH.

Once you have it installed, you can execute redis-server and it will run on localhost:6379 by default. Check the redis.conf file that comes with the sources if you want to change some settings.

Usage

Stal requires a Resp compatible client. To make things easier, resp is listed as a runtime dependency so the examples in this document will work.

require "stal"

# Connect the client to the default host
resp = Resp.new("redis://localhost:6379")

# Use the Redis client to populate some sets
resp.call("SADD", "foo", "a", "b", "c")
resp.call("SADD", "bar", "b", "c", "d")
resp.call("SADD", "baz", "c", "d", "e")
resp.call("SADD", "qux", "x", "y", "z")

Now we can perform some set operations with Stal:

expr = ["SUNION", "qux", ["SDIFF", ["SINTER", "foo", "bar"], "baz"]]

Stal.solve(resp, expr)
#=> ["b", "x", "y", "z"]

Stal translates the internal calls to "SUNION", "SDIFF" and "SINTER" into SDIFFSTORE, SINTERSTORE and SUNIONSTORE to perform the underlying operations, and it takes care of generating and deleting any temporary keys.

For more information, refer to the repository of the Stal script.

Installation

Add this to your application's shard.yml:

dependencies:
  stal:
    github: soveran/stal-crystal
    branch: master

More Repositories

1

cuba

Rum based microframework for web development.
Ruby
1,429
star
2

ohm

Object-Hash Mapping for Redis
Ruby
1,390
star
3

micromachine

Minimal Finite State Machine
Ruby
522
star
4

clac

Command-line, stack-based calculator with postfix notation
C
350
star
5

map

Map lines from stdin to commands
C
221
star
6

mote

Minimum Operational Template
Ruby
216
star
7

nest

Generate nested namespaced keys for key-value databases.
Ruby
185
star
8

ost

Redis based queues and workers.
Ruby
166
star
9

toro

Tree oriented routing
Crystal
144
star
10

syro

Simple router for web applications
Ruby
135
star
11

cargo

Require libraries without cluttering your namespace.
Ruby
127
star
12

scrivener

Validation frontend for models.
Ruby
124
star
13

clap

Command line argument parsing
Ruby
90
star
14

ohm-crystal

Ohm for Crystal
Crystal
71
star
15

disque-rb

Disque client for Ruby
Ruby
68
star
16

gs

Gemset management
Ruby
67
star
17

totp

Time-based One-Time Passwords
Ruby
44
star
18

mailcat

Fake SMTP server that prints emails to stdout
C
38
star
19

chen

Change directory entries with your text editor
C
37
star
20

finist

Redis based Finite State Machine
Ruby
36
star
21

spawn

A ridiculously simple fixtures replacement for your web framework of choice.
Ruby
36
star
22

redisurl

Connect to Redis using a REDIS_URL and the redigo client.
Go
33
star
23

hart

Hash router
Ruby
24
star
24

redisent

Sentinels aware Redis client.
Ruby
22
star
25

stal-ruby

Set algebra solver for Redis
Ruby
22
star
26

relay

Relay commands over SSH
Ruby
21
star
27

resp

Lightweight RESP client for Lua
Lua
21
star
28

lomo

Apply a lomo filter to your pictures from the command line using ImageMagick.
Ruby
19
star
29

override

The as-simple-as-possible-but-not-simpler stubbing library.
Ruby
16
star
30

ox

Skeleton for a Cuba-based JSON API.
Ruby
16
star
31

terco

Obstinate DNS
Ruby
16
star
32

nido

Structured keys helper
Ruby
14
star
33

syro-demo

Demo application with Syro
Ruby
14
star
34

resp-crystal

Lightweight RESP client
Crystal
14
star
35

mt

Mail tester daemon.
Ruby
13
star
36

stringent

Generate a string with a target entropy
Ruby
12
star
37

rediscan

Scanner for Redis keyspace
Ruby
12
star
38

hypertext

Hypertext authoring with Ruby
Ruby
11
star
39

cuba-book

Cuba Book
11
star
40

sc

List of HTTP status codes.
Ruby
11
star
41

filmo

A single page presentation tool.
11
star
42

drawer

Ultra slim file-based cache
Ruby
10
star
43

finist.lua

Redis based Finite State Machine
Lua
10
star
44

nest-crystal

Object Oriented Keys for Redis
Crystal
9
star
45

basica

Basic authentication library.
Ruby
8
star
46

rino

Remove a file by its inode number
C
7
star
47

seg.rb

Segment matcher for paths
Ruby
7
star
48

trim

Read from stdin and remove a prefix from each line
C
7
star
49

seg

Segment matcher for paths
Crystal
7
star
50

tas

Trees as strings
Ruby
6
star
51

stal

Set algebra solver for Redis
Lua
6
star
52

pac

Package management for Lua libraries.
Shell
6
star
53

prep

Read from stdin and prepend a string to each line while preserving identation.
C
6
star
54

m4s2

Static Site Generator
HTML
5
star
55

contract

Contract helper
Ruby
5
star
56

rel

Ruby client for the Bandicoot database.
Ruby
4
star
57

ook

Object Oriented Keys for Redis
Ruby
4
star
58

loco

Lines of code counter
C
4
star
59

homebrew-tools

Formulae for Homebrew
Ruby
4
star
60

walk

Walk a directory tree and print the name of every regular file
C
4
star
61

textorama

Text slides for the terminal
Shell
4
star
62

rediscan.lua

Scanner for Redis keyspace in Lua
Lua
3
star
63

seg.go

Segment matcher for paths
Go
3
star
64

look

Add a vendor directory to your load path.
Ruby
3
star
65

app

Cuba application template for gn, the file generator.
Ruby
2
star
66

packer

Require different versions of the same Cargo-compatible gem
Ruby
2
star
67

tele.sh

2
star
68

ers

AWK script easy replacements in templates
Awk
2
star
69

soveran.github.io

2
star
70

filter

Workflow template for gn.
Ruby
1
star
71

remoto

Ruby
1
star
72

ohm-scripts

Lua scripts for Ohm compatible libraries
Lua
1
star
73

gem

Gem template for gn, the file generator.
Ruby
1
star
74

ostgo

Ost client.
Go
1
star
75

miga

Breadcrumb name of the working directory
C
1
star