Skip to content

Instantly share code, notes, and snippets.

View abhishekmishragithub's full-sized avatar
🎯
Focusing

Abhishek abhishekmishragithub

🎯
Focusing
View GitHub Profile
@abhishekmishragithub
abhishekmishragithub / latency.txt
Created March 11, 2024 15:48 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@abhishekmishragithub
abhishekmishragithub / workshop_multi_region_deployments.md
Last active October 27, 2022 00:58 — forked from dmagda/workshop_multi_region_deployments.md
[Workshop] YugabyteDB Multi-Region Deployments
@abhishekmishragithub
abhishekmishragithub / stripe-credit-card-numbers.md
Last active October 11, 2022 20:40 — forked from rymawby/stripe-credit-card-numbers.md
Stripe test credit card numbers for use in development

#Test credit card numbers to use when developing with Stripe

4242424242424242 Visa

4012888888881881 Visa

4000056655665556 Visa (debit)

The PATH is an important concept when working on the command line. It's a list of directories that tell your operating system where to look for programs, so that you can just write script instead of /home/me/bin/script or C:\Users\Me\bin\script. But different operating systems have different ways to add a new directory to it:

Windows

  1. The first step depends which version of Windows you're using:
  • If you're using Windows 8 or 10, press the Windows key, then search for and
@abhishekmishragithub
abhishekmishragithub / README.md
Created August 8, 2022 11:39 — forked from Restuta/README.md
How to get IP Ranges for Heroku

Ip Ranges

Sometimes it's useful to know what IP ranges our servers are operating in. Since we run on Heroku, it's a little complicated. However, Heroku runs on AWS, which has this page dedicated to IP Ranges by Region.

Heroku recommends using this to identify which region are bing in use. If dynos are run in common spaces in US region, we can look up information about this region using Heroku's API:

using httpie:

 http https://api.heroku.com/regions/us "Accept:application/vnd.heroku+json; version=3"

Startup Scripts

Start a database instance within a few seconds on you machine.

PostgreSQL

Start

docker run --name postgresql -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=password \
git_current_branch () {
local ref
ref=$(command git symbolic-ref --quiet HEAD 2> /dev/null)
local ret=$?
if [[ $ret != 0 ]]
then
[[ $ret == 128 ]] && return
ref=$(command git rev-parse --short HEAD 2> /dev/null) || return
fi
echo ${ref#refs/heads/}
@abhishekmishragithub
abhishekmishragithub / post_standup_flow.py
Created September 1, 2021 09:08 — forked from cicdw/post_standup_flow.py
complete code of the standup Prefect flow
import datetime
from google.cloud.firestore import Client
import random
import requests
import prefect
from prefect import Flow, Parameter, task
from prefect.client import Secret
from prefect.schedules import CronSchedule

App Install Plan

Critical