Probability of two people serendipitously meeting somewhere

The problem of finding the probability of two people serendipitously meeting eachother somewhere is non-trivial ! Some relevant links are : https://www.mathpages.com/home/kmath124/kmath124.htm https://stats.stackexchange.com/questions/15448/probability-of-two-people-meeting

 June 24, 2024  •   1 min  •   23 words  •   Suyog Garg

Working with Cloudflare workers

A cloudflare enviroment can be used to deploy any reasonably sized application on to an internet server without having to pay for server storage purchase. The deployed application page is then linked to universal web address and can reached on it. A wrangler Javascript worker application to read and publish a formatted a letterboxd-diary given the username can be created by following the process described below. This app is a static front‑end (HTML/CSS/JS) that calls a Google Apps Script backend....

 June 24, 2024  •   3 min  •   592 words  •   Suyog Garg

git submodules are erroneous

In the name of sheer simplicity, it would be advised to best not use the git submodule utility ! If there is the utmost need to have one directory within the other, then try to have only git repository among them, yeah. Or else, try to separate out the repositories into separate folders, yah ! It may happen that you may not be able to see new changes in the main directory after using submodule for a while....

 May 2, 2024  •   1 min  •   127 words  •   Suyog Garg

Do not ask for Git passphrase on each commit

So that we don’t have to write the passphrase each time we do git commit ! Add this to the bash file : env=~/.ssh/agent.env agent_load_env () { test -f "$env" && . "$env" >| /dev/null ; } agent_start () { (umask 077; ssh-agent >| "$env") . "$env" >| /dev/null ; } agent_load_env # agent_run_state: 0=agent running w/ key; 1=agent w/o key; 2= agent not running agent_run_state=$(ssh-add -l >| /dev/null 2>&1; echo $?...

 March 28, 2024  •   1 min  •   101 words  •   Suyog Garg

pdf2jpg via terminal

How to convert PDF to JPG/PNG (images) via command line prompts on MacOS zsh terminal. STEP 1 : Install poppler via brew install poppler STEP 2a : If you only wanna convert one file, run, pdftoppm -jpeg -r 300 path-to-input-folder/**/*.pdf path-to-output-folder/* STEP 2b : If you wanna loop through all the files in then execute, for file in path-to-input-folder/**/*; do pdftoppm -jpeg -r 300 $file path-to-output-folder/*; done; See also : https://stackoverflow....

 March 22, 2024  •   1 min  •   71 words  •   Suyog Garg