This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def direction_to_increment(direction): | |
"""Map a direction to x and y increments.""" | |
mapping = { | |
"N": (0, 1), | |
"NE": (1, 1), | |
"E": (1, 0), | |
"SE": (1, -1), | |
"S": (0, -1), | |
"SW": (-1, -1), | |
"W": (-1, 0), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Welcome to Serverless! | |
# | |
# Happy Coding! | |
service: cross-region-sns-subscriber | |
# Keep environment specific configurations in separate files | |
custom: ${file(config/${env:STAGE}.json)} | |
provider: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urlparse | |
import argparse | |
import redis | |
import sys | |
from multiprocessing import Pool | |
import signal | |
def parse_redis_url(s): | |
url = urlparse.urlparse(s) | |
if not url.scheme: |