Skip to content

Instantly share code, notes, and snippets.

View jadhavmanoj's full-sized avatar
🎯
Focusing

Manoj Jadhav jadhavmanoj

🎯
Focusing
View GitHub Profile
@maheshgawali
maheshgawali / stateful_dispatcher.py
Created August 7, 2018 07:36
a stateful function dispatcher using simple python using chaining vs maintaining a dict
#!/usr/bin/env python3
# OBJECTIVE
# 1. script should be able to pick up from where it left off, assume that state is saved extrenally in some datastore
# 2. order of execution of methods matters
class statefulDispatcherUsingChaining():
def __init__(self, current_state=None):
self.current_state = "one" if not current_state else current_state
@maheshgawali
maheshgawali / bb_pr_checker.py
Created August 10, 2018 09:01
simple python script to check if a PR exists for the current branch in bitbucket pipeline, execute bitbucket pipelines only if a PR is created for a branch
#!/usr/bin/env python3
import requests
import json
import argparse
PAGE_LENGTH = '50'
PR_STATE = 'OPEN'