Skip to content

Instantly share code, notes, and snippets.


echorand (Amit Saha) amitsaha

View GitHub Profile
amitsaha /
Last active May 28, 2022
Extras handling in micropip

Explanation of micropip's extras handling

From my understanding, a transaction corresponds to a single micropip.install() command.

The method add_requirement_inner() gets called for each package that we will be installing as part of the current microppip transaction.

So, consider the following:

  • pkga with optional dependency marker, all which will bring in packages, depa and depb
amitsaha / powm_pyodide.html
Last active May 8, 2022
Pyowm + Pyodide - patching "requests" module
View powm_pyodide.html
<!DOCTYPE html>
<script src=""></script>
Pyodide test page <br>
Open your browser console to see Pyodide output
<script type="text/javascript">
async function main(){
amitsaha / client.go
Created Apr 12, 2022 — forked from codingbaobao/client.go
grpc interceptor in Python/Golang
View client.go
package main
import (
pb "example/helloworld"
amitsaha /
Created Mar 6, 2022 — forked from nrjdalal/
Create Virtual Machines using QEMU on Silicon based Apple Macs

Install QEMU on Silicon based Apple Macs (June 2021)

Option 1 - Automatically

zsh -c "$(curl -fsSL"

Option 2 - Manually

  • Install Xcode command line tools

xcode-select --install
amitsaha / main.go
Created Jul 23, 2021
Example of recreating a gRPC stream for bidi - if the client gets disconnected or there is another issue
View main.go
func createHelpStream(c svc.UsersClient) (
users.Users_GetHelpClient, error,
) {
return c.GetHelp(
amitsaha /
Last active Jul 16, 2021
Go's net/http Server Behavior When a handler panics

Consider a test HTTP server in Go:

package main

import "net/http"

func myHandler1(w http.ResponseWriter, r *http.Request) {
	panic("I panicked")
amitsaha /
Last active Jan 22, 2021
# Python Web Conference 2021 accepted talk

Python Web Conference 2021 accepted talk

In this talk, I will discuss the next steps after you have written a web application. Python frameworks and libraries makes it really easy to write a highly performant web application out of the box, but the problems that come next needs a number of building blocks and tools to come together.

We will talk about deploying your web application and discuss scaling up and down policies so that we can cater to peak traffic demands. We will discuss how we can peak into our application’s performance by exporting “health” status and metrics, and learn about implementing distributed tracing into our web application.

You have just implemented your next big feature, your pull request has been merged, testing looks good and you want to roll it out to your users. But, have you thought about monitoring, observability, and logging? These three things are usually an afterthought. They shouldn't be. On this page, I will point to resources and discuss about the things that we shou

amitsaha / go.mod
Created May 19, 2020
Kubernetes: List all running pods and their pod security policies using Golang
View go.mod
go 1.14
require ( v0.18.0 v0.18.0
amitsaha /
Created Aug 15, 2019
test python + prometheus
from prometheus_client import multiprocess
from prometheus_client import generate_latest, CollectorRegistry, CONTENT_TYPE_LATEST, Gauge
from flask import Flask, Response
app = Flask(__name__)
from flask import request
from prometheus_client import Counter, Histogram
import time
amitsaha / go.mod
Last active Aug 15, 2019
Redis + go
View go.mod
go 1.12
require v6.15.2+incompatible