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 November 5, 2024 02:14
Learn Go in ~5mins
@miraculixx
miraculixx / README
Last active October 14, 2024 08:42
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 September 10, 2024 23:06
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 November 17, 2024 05:38
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 October 22, 2024 12:13
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 November 17, 2024 01:08
The introduction to Reactive Programming you've been missing