Skip to content

Instantly share code, notes, and snippets.

View Dineshkarthik's full-sized avatar
🎯
Focusing

DK Dineshkarthik

🎯
Focusing
View GitHub Profile
@Dineshkarthik
Dineshkarthik / 004-select-flask-as-python-web-framework.md
Last active August 29, 2023 14:12
Example Architecture Decision Records (ADRs)

ADR-004: Select Flask as Python Web Framework

Context

We need to select a Python web framework for our new analytics application. Key criteria:

  • Easy to use and get started
  • Good performance
  • Flexible and modular
  • Built-in caching support

Keybase proof

I hereby claim:

  • I am dineshkarthik on github.
  • I am dineshkarthik (https://keybase.io/dineshkarthik) on keybase.
  • I have a public key ASCQCOxeaBBY6Y9ywFdmgq6nGcDcpIkd8ubu2RvWy8TjJgo

To claim this, I am signing this object:

@Dineshkarthik
Dineshkarthik / random_wiki_telegram_bot.py
Created January 7, 2020 13:48
A telegram bot that fetches and provides the user with a random Wikipedia article
#!/usr/bin/env python3
# The MIT License (MIT)
# Copyright (c) 2020 Dineshkarthik Raveendran
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@Dineshkarthik
Dineshkarthik / get_random_wiki_article.py
Created January 4, 2020 13:04
Getting Wikipedia Article's summary using WIkimedia page content rest api and Random article generation
import requests
random_article = requests.get("https://en.wikipedia.org/wiki/Special:Random")
article_name = random_article.url.split("/")[-1]
url = f"https://en.wikipedia.org/api/rest_v1/page/summary/{article_name}"
article_data = requests.get(url).json()
print(article_data)
{'type': 'standard',
'title': 'Vohimasina Nord',
# -*- coding: utf-8 -*-
# Copyright 2019 Dineshkarthik Raveendran
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
@Dineshkarthik
Dineshkarthik / dynamodb_replicate_table.py
Last active June 20, 2021 10:27
Copy dynamoDB table to another region using python, boto3. This script creates an exact replica of the table with same key schema and attribute definitions.
# Copyright (C) 2018 Dineshkarthik Raveendran
from __future__ import print_function # Python 2/3 compatibility
import boto3
import argparse
def replicate(table_name, existing_region, new_region, new_table_name):
"""
Replicate table in new region.
@Dineshkarthik
Dineshkarthik / install-bot.sh
Last active March 7, 2017 04:18
Automating Package installation in Linux
#!/usr/bin/env bash
command_exists() {
command -v "$@" > /dev/null 2>&1
}
# Ensure that wget exists
if command_exists wget; then
wget='wget -O'
else