Skip to content

Instantly share code, notes, and snippets.

View evandempsey's full-sized avatar

Evan Dempsey evandempsey

View GitHub Profile
@evandempsey
evandempsey / cypress_support_hooks.js
Created March 5, 2020 12:37 — forked from yagudaev/cypress_support_hooks.js
Cypress Fetch Support Workaround - replaces fetch request with traditional XHR so cypress can track them
// cypress/support/hooks.js
// Cypress does not support listening to the fetch method
// Therefore, as a workaround we polyfill `fetch` with traditional XHR which
// are supported. See: https://github.com/cypress-io/cypress/issues/687
enableFetchWorkaround()
// private helpers
function enableFetchWorkaround() {
let polyfill
@evandempsey
evandempsey / celery.sh
Created October 29, 2018 18:32 — forked from amatellanes/celery.sh
Celery handy commands
/* Useful celery config.
app = Celery('tasks',
broker='redis://localhost:6379',
backend='redis://localhost:6379')
app.conf.update(
CELERY_TASK_RESULT_EXPIRES=3600,
CELERY_QUEUES=(
Queue('default', routing_key='tasks.#'),
@evandempsey
evandempsey / celery_tasks_error_handling.py
Created October 23, 2018 17:45 — forked from darklow/celery_tasks_error_handling.py
Celery tasks error handling example
from celery import Task
from celery.task import task
from my_app.models import FailedTask
from django.db import models
@task(base=LogErrorsTask)
def some task():
return result
class LogErrorsTask(Task):