Skip to content

Instantly share code, notes, and snippets.

View mukund-murali's full-sized avatar

Mukund Muralikrishnan mukund-murali

  • Wayve.ai
  • London
View GitHub Profile
@mukund-murali
mukund-murali / sentry_rate_limiter.py
Last active April 7, 2020 10:41
Sentry supports per project rate limiting only in it's business plan and it's controlled at the server side. Here is some monkey patching that makes it available at the SDK level.
"""Rate limiting monkey patch for Sentry error reporting SDK."""
from datetime import datetime
from typing import Callable
import sentry_sdk
class RateLimit:
def __init__(self, limit: int = 100, period: int = 60 * 60):
@mukund-murali
mukund-murali / del_merged_branch.sh
Created December 13, 2018 05:22
Deletes a branch if master has it's changes
if [ -z $1 ]; then echo "Specify branch name"; exit; fi
git checkout master
git pull origin master
git checkout $1
git merge master
git checkout master
out=`git diff master $1`
if [ -z "$out" ]; then
git branch -D $1
else
@mukund-murali
mukund-murali / apriori.py
Created July 27, 2018 08:06
Apriori algorithm implementation
"""
Implements Apriori algorithm as defined in https://www.slideshare.net/INSOFE/apriori-algorithm-36054672
Usage:
from apriori import apriori
dataset = [
[1, 2],
[2, 3],
sa ri1 ga1 ma1 pa tha1 ni1 sa
sa ri1 ga1 ma1 pa tha1 ni2 sa
sa ri1 ga1 ma1 pa tha1 ni3 sa
sa ri1 ga1 ma1 pa tha2 ni2 sa
sa ri1 ga1 ma1 pa tha2 ni3 sa