This file contains hidden or 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 click | |
import requests | |
# TODO change api key to your own api key, this is a sample key | |
SAMPLE_API_KEY = 'b1b15e88fa797225412429c1c50c122a1' | |
def current_weather(location, api_key=SAMPLE_API_KEY): | |
url = 'https://api.openweathermap.org/data/2.5/weather' |
This file contains hidden or 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 redis | |
import threading | |
class Listener(threading.Thread): | |
def __init__(self, r, channels): | |
threading.Thread.__init__(self) | |
self.redis = r | |
self.pubsub = self.redis.pubsub() | |
self.pubsub.subscribe(channels) | |
This file contains hidden or 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
FROM debian:jessie-slim | |
RUN mkdir /node_source | |
WORKDIR /node_source | |
RUN apt-get update && apt-get --yes install wget | |
RUN wget https://nodejs.org/dist/v5.7.0/node-v5.7.0-linux-x64.tar.gz | |
RUN mkdir -p /opt/nodejs | |
RUN tar -xvzf node-v5.7.0-linux-x64.tar.gz -C /opt/nodejs/ |
NewerOlder