Skip to content

Instantly share code, notes, and snippets.

View HarshKapadia2's full-sized avatar
💛
"Kindness always wins." -Selena Gomez

Harsh Kapadia HarshKapadia2

💛
"Kindness always wins." -Selena Gomez
View GitHub Profile
#include <stdio.h>
#include <limits.h>
int main()
{
printf("an int has %lu bytes ", sizeof(int));
printf("and it can fit up to %d inside it\n", INT_MAX);
printf("a long long has %lu bytes ", sizeof(long long));
printf("and it can fit up to %lld inside it\n\n", LLONG_MAX);
@HarshKapadia2
HarshKapadia2 / latency.markdown
Created August 19, 2023 06:54 — forked from hellerbarde/latency.markdown
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@HarshKapadia2
HarshKapadia2 / label-with-title-and-name.html
Last active January 12, 2024 19:57
To print on labels and A4 pages. Code by Kartik Soneji (https://github.com/KartikSoneji) and Harsh Kapadia (https://harshkapadia.me).
<!DOCTYPE html>
<html>
<head>
<style>
@font-face {
font-family: "Anaktoria";
src: url("https://ourtech.community/static/fonts/anaktoria.woff") format("woff");
font-weight: normal;
font-style: normal;
font-display: swap;

How to estimate effort

By Golo Roden, translated from German with the help of DeepL

Every developer knows the challenge of estimating effort for development code. Very few like to do it. Why is estimating so unpopular, why is it even necessary, and what should you look for?

Why estimate effort?

The question of why it's necessary to estimate effort at all is easy to answer. Knowing how long a task is expected to take is essential for planning who in a team can do what and when. Even across team boundaries, a certain amount of time planning is essential; after all, teams have to be coordinated and resources have to be procured. In addition, other departments such as marketing also have an interest in being involved in planning at an early stage.

@HarshKapadia2
HarshKapadia2 / readme.md
Created May 6, 2022 22:06 — forked from jimmywarting/readme.md
Cors proxies
Exposed headers
Service SSL status Response Type Allowed methods Allowed headers
@HarshKapadia2
HarshKapadia2 / git-compressing-and-deltas.md
Created September 26, 2021 18:32 — forked from matthewmccullough/git-compressing-and-deltas.md
Git, Compression, and Deltas - An explanation

Git Compression of Blobs and Packfiles.

Many users of Git are curious about the lack of delta compression at the object (blob) level when commits are first written. This efficiency is saved until the pack file is written. Loose objects are written in compressed, but non-delta format at the time of each commit.

A simple run though of a commit sequence with only the smallest change to the image (in uncompressed TIFF format to amplify the observable behavior) aids the understanding of this deferred and different approach efficiency.

The command sequence:

Create the repo:

@HarshKapadia2
HarshKapadia2 / links.md
Last active November 19, 2021 07:00
Harsh Kapadia's links
@HarshKapadia2
HarshKapadia2 / cors.md
Last active April 25, 2023 01:29
All about Cross-Origin Resource Sharing (CORS)!
@HarshKapadia2
HarshKapadia2 / git-commit-styleguide.md
Created October 9, 2020 22:16 — forked from rishavpandey43/git-commit-styleguide.md
This gist consist of the rules and best practice of good conventional git commit message

Git Commit Messages Style-Guides

  • Use the present tense ("Add feature" not "Added feature")
  • Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
  • Limit the first line to 72 characters or less
  • Reference issues and pull requests liberally after the first line
  • When only changing documentation, include [ci skip] in the commit title
  • Consider starting the commit message with an applicable emoji

Types