Skip to content

Instantly share code, notes, and snippets.

View manojbaishya's full-sized avatar
😎
Working from home

Manoj Baishya manojbaishya

😎
Working from home
View GitHub Profile
use std::{
fs::File,
io::{Read, Write},
time::Instant,
};
use tokio::task::{self, JoinHandle};
async fn compute() {
let handles: Vec<JoinHandle<_>> = (0..1000)
.map(|_| {

How to prepare for technical interviews at companies like Amazon, Flipkart, Google, Microsoft, Swiggy, Uber, etc?

Interview Rounds

Generally, there are two major types of technical interviews that companies have in India:

  • Problem Solving & Data Structures Round
  • Machine Coding Round

If you're aiming the traditional giants like Google, Microsoft, Amazon, etc, then you should focus solely on problem-solving & data structures (PS/DS).

@gerald-drissner
gerald-drissner / userChrome.css
Last active August 16, 2022 12:23
Adjust font size and color of email list (inbox; Posteingang) and message header in Thunderbird 68
/* Thunderbird 68 has changed its architecture.
Unfortunately, many great themes and plugins are not working anymore.
The font size of the message list, where the emails of your inbox is listed, is way too small.
The standard and dark mode is a bit too dark.
You can easily fix that:
1. Search for your profile.
-> In Linux, you will find that unter ~[home]/.thunderbird/<Profile name - usually quite cryptical>/
-> In Windows: C:\Users\<Windows user name>\AppData\Roaming\Thunderbird\Profiles\<Profile name>\
@cardil
cardil / JEP.md
Last active December 6, 2024 06:22
[Draft] JEP - Change name of imported type (aliasing)

Summary

Change name of imported type (aliasing)

Goals

The goal is to make code more productive and clean in cases where multiple classes with same name must be used in code. It should relief a developers frustration in that

@kellerza
kellerza / oauth2_session.py
Last active October 1, 2024 02:04
OAuth2 authentication with aiohttp and oauthlib (based on requests_oauthlib)
"""OAuth2Support for aiohttp.ClientSession.
Based on the requests_oauthlib class
https://github.com/requests/requests-oauthlib/blob/master/requests_oauthlib/oauth2_session.py
"""
# pylint: disable=line-too-long,bad-continuation
import logging
from oauthlib.common import generate_token, urldecode
from oauthlib.oauth2 import WebApplicationClient, InsecureTransportError
@joeytwiddle
joeytwiddle / async-await-forEach-alternatives.md
Last active December 24, 2024 06:42
Do not use forEach with async-await

Do not use forEach with async-await

TLDR: Use for...of instead of forEach() in asynchronous code.

For legacy browsers, use for...i or [].reduce()

To execute the promises in parallel, use Promise.all([].map(...))

The problem

@dmahugh
dmahugh / comparision.py
Created May 23, 2017 17:21
comparison of asynchronous HTTP requests (aiohttp/asyncio) and traditional sequential requests (with Requests library)
"""Comparison of fetching web pages sequentially vs. asynchronously
Requirements: Python 3.5+, Requests, aiohttp, cchardet
For a walkthrough see this blog post:
http://mahugh.com/2017/05/23/http-requests-asyncio-aiohttp-vs-requests/
"""
import asyncio
from timeit import default_timer
@leonardo-m
leonardo-m / gist:6e9315a57fe9caa893472c2935e9d589
Last active October 13, 2024 14:40
A selection of 101 LINQ Samples converted to Rust
// Port of the C# 101 LINQ Samples rewritten into Apple's Swift 3.
#![feature(ordering_chaining, step_by)]
fn main() {
// linq5: Where - Indexed
/*
//c#
public void Linq5()
{
@CMCDragonkai
CMCDragonkai / regular_expression_engine_comparison.md
Last active December 23, 2024 01:08
Regular Expression Engine Comparison Chart

Regular Expression Engine Comparison Chart

Many different applications claim to support regular expressions. But what does that even mean?

Well there are lots of different regular expression engines, and they all have different feature sets and different time-space efficiencies.

The information here is just copied from: http://regular-expressions.mobi/refflavors.html

@pv
pv / colorized_voronoi.py
Last active June 27, 2024 22:07
Colorized Voronoi diagram with Scipy, in 2D, including infinite regions
import numpy as np
import matplotlib.pyplot as plt
from scipy.spatial import Voronoi
def voronoi_finite_polygons_2d(vor, radius=None):
"""
Reconstruct infinite voronoi regions in a 2D diagram to finite
regions.
Parameters