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 time | |
def run_me_now(): | |
print("Am running") | |
time.sleep(3) # suspends execution for the given number of seconds | |
print("Am still running") | |
time.sleep(3) |
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
@periodic_task(run_every=(crontab(minute='*/1')), | |
name="tasks.news_feed_task", ignore_result=True) | |
def news_feed_task(): | |
newsApi = NewsApiFeeds() | |
newsApi.get_feeds() |
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
Group("mynewsfeed").send({ | |
# WebSocket text frame, with JSON content | |
"text": json.dumps(article), | |
}) |
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
var glyphicons = [{ | |
glyphicon: 'glyphicon glyphicon-warning-sign', | |
theme: 'update-split update-info' | |
}, { | |
glyphicon: 'glyphicon glyphicon-sunglasses', | |
theme: 'update-split update-success' | |
}, { | |
glyphicon: 'glyphicon glyphicon-user', | |
theme: 'update-split update-danger' | |
}, { |
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
from __future__ import absolute_import | |
import random | |
import requests | |
import pydash | |
import json | |
import logging | |
from channels import Group | |
from celery.task.schedules import crontab |
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 random | |
import time | |
from dask.distributed import Client | |
def inc(x: int) -> int: | |
time.sleep(random.randrange(1, 2, 1)) | |
return x + 1 |
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
FROM python:3.6-slim-buster | |
LABEL maintainer="Timothy Mugayi <timothy.mugayi@gmail.com>" | |
ARG ARTIFACTORY_USERNAME | |
ARG ARTIFACTORY_SECRET_TOKEN | |
ARG ARTIFACTORY_URL=https://$ARTIFACTORY_USERNAME:$ARTIFACTORY_SECRET_TOKEN@artifactory.com/api/pypi/simple | |
RUN echo "Oh dang look at that $ARTIFACTORY_URL" |
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
cplex==12.8.0.0 | |
gams-sdk==0.0.1 --install-option="--gams-ignore=n" --install-option="--gams-ignore-studio=y" --install-option="--gams-remove-examples=y" | |
dask==2.11.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
# download and use an existing image which already has Conda installed and set up | |
FROM continuumio/miniconda3:4.7.12 | |
# Dumb init minimal init system intended to be used in Linux containers | |
RUN wget -O /usr/local/bin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64 | |
RUN chmod +x /usr/local/bin/dumb-init | |
# Because miniconda3 image releases may sometimes be behind we need to play catchup manually | |
RUN conda update conda && conda install "conda=4.8.2" |
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
name: root | |
channels: | |
- https://repo.continuum.io/pkgs/free | |
- defaults | |
- conda-forge | |
dependencies: | |
- pip |