Skip to content

Instantly share code, notes, and snippets.

View norus's full-sized avatar
:octocat:
Compiling...

Ruslan V norus

:octocat:
Compiling...
View GitHub Profile
@norus
norus / redis_proto.py
Created October 22, 2020 14:14
Redis protocol generation
def redis_protocol(cmd):
proto = "*%d\r\n" % len(cmd.split(' '))
for arg in cmd.split(' '):
proto += "$%d\r\n%s\r\n" % (len(arg), arg)
return proto
@norus
norus / fifa.py
Last active April 16, 2018 18:37
Fifa album sticker intersect finder
#!/usr/bin/env python
import sys
if len(sys.argv) != 3:
print '''
(!) First argument should be diego_has.txt
(!) Second argument should be diego_needs.txt
Run like this:\n\tpython fifa.py diego_has.txt diego_needs.txt
'''