Skip to content

Instantly share code, notes, and snippets.

View timothymugayi's full-sized avatar
🎯
Focusing

Timothy Mugayi timothymugayi

🎯
Focusing
View GitHub Profile
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)
@periodic_task(run_every=(crontab(minute='*/1')),
name="tasks.news_feed_task", ignore_result=True)
def news_feed_task():
newsApi = NewsApiFeeds()
newsApi.get_feeds()
Group("mynewsfeed").send({
# WebSocket text frame, with JSON content
"text": json.dumps(article),
})
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'
}, {
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
import random
import time
from dask.distributed import Client
def inc(x: int) -> int:
time.sleep(random.randrange(1, 2, 1))
return x + 1
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"
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
# 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"
name: root
channels:
- https://repo.continuum.io/pkgs/free
- defaults
- conda-forge
dependencies:
- pip