Skip to content

Instantly share code, notes, and snippets.

View anudeepsamaiya's full-sized avatar
:bowtie:
Always ready!

Anudeep Samaiya anudeepsamaiya

:bowtie:
Always ready!
View GitHub Profile
@prologic
prologic / LearnGoIn5mins.md
Last active July 3, 2024 04:05
Learn Go in ~5mins
@miraculixx
miraculixx / README
Last active February 7, 2023 23:12
Celery worker blocks on rate limited task
Celery worker blocks on rate limited task
=========================================
by github.com/miraculixx
Problem:
If a worker has a rate_limit active on some task, and that task
arrives (is received) more often than the rate limit interval, all
worker processes will block on these task instances and stop
consuming other tasks as soon as the prefetch count has maxed out
@radzhome
radzhome / json_schema_to_django_model.py
Last active May 9, 2024 20:16
Converts json schema to django models.py
"""
Json Schema to Django Model
"""
import json
import argparse
import logging
import os
def determine_model_name(model_id=None, filename=None):
@linar-jether
linar-jether / celery_task_monitor.py
Created June 22, 2017 13:36
Celery task monitor, logs task state to MongoDB
import pickle
import threading
from Queue import Queue
import time
from bson import InvalidDocument
from celery.utils.log import get_task_logger
logger = get_task_logger(__name__)
@r3m0t
r3m0t / makemigrations.py
Created April 27, 2017 20:55
Migration conflict file
# coding: utf-8
"""Cause git to detect a merge conflict when two branches have migrations."""
# myapp/management/commands/makemigrations.py
# you'll need myapp/management/commands/__init__.py and myapp/management/__init__.py in PY2, see Django docs
from __future__ import absolute_import, unicode_literals
import io
import os
import six
@anudeepsamaiya
anudeepsamaiya / volley-POST-example.java
Created May 21, 2016 17:53 — forked from mombrea/volley-POST-example.java
Example of performing a POST request using Google Volley for Android
public static void postNewComment(Context context,final UserAccount userAccount,final String comment,final int blogId,final int postId){
mPostCommentResponse.requestStarted();
RequestQueue queue = Volley.newRequestQueue(context);
StringRequest sr = new StringRequest(Request.Method.POST,"http://api.someservice.com/post/comment", new Response.Listener<String>() {
@Override
public void onResponse(String response) {
mPostCommentResponse.requestCompleted();
}
}, new Response.ErrorListener() {
@Override
@vasanthk
vasanthk / System Design.md
Last active July 8, 2024 22:11
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@amatellanes
amatellanes / celery.sh
Last active July 8, 2024 03:31
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.#'),
@staltz
staltz / introrx.md
Last active July 8, 2024 15:46
The introduction to Reactive Programming you've been missing