Skip to content

Instantly share code, notes, and snippets.

amitsaha /
Last active May 28, 2022 07:45
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 11:49
Pyowm + Pyodide - patching "requests" module
<!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 April 12, 2022 01:26 — forked from codingbaobao/client.go
grpc interceptor in Python/Golang
package main
import (
pb "example/helloworld"
amitsaha /
Created March 6, 2022 04:34 — 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 July 23, 2021 03:04
Example of recreating a gRPC stream for bidi - if the client gets disconnected or there is another issue
func createHelpStream(c svc.UsersClient) (
users.Users_GetHelpClient, error,
) {
return c.GetHelp(
amitsaha /
Last active July 16, 2021 23:13
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 January 22, 2021 00:44
# 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 05:57
Kubernetes: List all running pods and their pod security policies using Golang
go 1.14
require ( v0.18.0 v0.18.0
amitsaha /
Created August 15, 2019 06:34
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 August 15, 2019 00:03
Redis + go
go 1.12
require v6.15.2+incompatible