Skip to content

Instantly share code, notes, and snippets.

View aatishnn's full-sized avatar

Aatish Neupane aatishnn

View GitHub Profile
@darklow
darklow / celery_tasks_error_handling.py
Last active September 10, 2024 19:47
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):
@aatishnn
aatishnn / binarymaxheap.c
Last active June 3, 2021 07:24
Priority Queue and Max-heap implementation in C (Inspired from https://gist.github.com/martinkunev/1365481)
// Array representation according to Wikipedia article but starts from 0 index.
#include <stdio.h>
#include <stdlib.h>
struct heap {
int size;
int count;
int *heaparr;
};