Skip to content

Instantly share code, notes, and snippets.

Steve Pike stringfellow

Block or report user

Report or block stringfellow

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
stringfellow /
Last active Aug 8, 2018
Celery hang problem

Celery 4.1.0, Redis client 2.10.6, Redis server 4.0

I have a problem that seems to be related to synchronous subtasks, except that none of the workarounds (or indeed the errors/warnings that I should expect from the docs) are having any effect.

I have 3 worker servers, A B and C

  • A and B run the same codebase.
  • A calls apply_async of a Task1. Get/Forget not called (it doesn't care about the result itself, but we want the result stored in the backend)
  • Task1 gets run by server B.
  • Within Task1 (now executed on server B) - Task2 from another codebase is called - using send_task (since the codebase is not shared here).

Keybase proof

I hereby claim:

  • I am stringfellow on github.
  • I am stringfellow ( on keybase.
  • I have a public key ASDXUKQ063VHceGQE6EEdI1OX86qMYngre_FK_7K5eqnnQo

To claim this, I am signing this object:

stringfellow / slinear vs linear
Last active Sep 7, 2018
linear & slinear interpolation of constant data
View slinear vs linear
pandas slinear: [60.0, 60.0, 60.0, 60.0, 59.999999999999993, 60.0, 60.0, 60.0]
pandas linear: [60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0]
scipy slinear: [60.0, 60.0, 60.0, 60.0, 59.999999999999993, 60.0, 60.0, 60.0]
scipy linear: [60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0]
FAIL: Proof that linear and slinear are not equal.
Traceback (most recent call last):
File "....", line 329, in test_slinear_versus_linear
stringfellow /
Created Oct 10, 2016
Showing how to make a Bokeh stacked area with hover labels per-series
def stacked_area(df, colours, series_noun, **kwargs):
"""Return a stacked area plot."""
columns = df.columns
areas = stacked(df, columns)
x2 = np.hstack((df.index[::-1], df.index))
p = figure(
width=900, height=600, tools=[
HoverTool(tooltips=[(series_noun, "@name")])
stringfellow /
Created Mar 17, 2016
Simple Django profiling middleware
# -*- coding: utf-8 -*-
import cProfile
import pstats
from django.conf import settings
class ProfileStatsMiddleware(object): # pragma: no cover
"""Super light-weight cProfile/pstats profile middleware."""
View ebay_sold_averagerer.js
View mapproxy.bat
call "C:\OSGeo4w64\bin\o4w_env.bat"
IF NOT EXIST C:\mapproxy (
easy_install virtualenv
mkdir C:\mapproxy
cd C:\mapproxy
virtualenv --system-site-packages env
pip install pyreadline MapProxy ipython lxml
mapproxy-util create -t base-config mapactionproxy
cd mapactionproxy
stringfellow /
Created Jul 12, 2012
Bash wrapper script to silence cron if there are no errors, and print out if there are
exec 6>&1
exec > $logfile 2>&1
exec 1>&6 6>&-
if [ $RETVAL -ne 0 ]; then
echo "FAILURES:"
cat $logfile
stringfellow /
Created May 18, 2012
Spinejs - django-tastypie integration base ModelResource class
#!/usr/bin/env python
# -*- coding: iso-8859-15 -*-
from tastypie.resources import ModelResource
class SpineFrontedResource(ModelResource):
"""A base model resource for spine-fronted models.
* Bins the 'id' that spine sends.
* Removes 'meta' from the list, returns only objects.
stringfellow /
Created May 11, 2012
TMS to OSM directory conversion script
import os
import shutil
import argparse
import commands
from datetime import datetime
import progressbar as pb
except ImportError:
You can’t perform that action at this time.