Skip to content

Instantly share code, notes, and snippets.

View suchoudh's full-sized avatar
💭
Applying Technology to real world problems.

Sunil Choudhary suchoudh

💭
Applying Technology to real world problems.
View GitHub Profile
@suchoudh
suchoudh / taskcontext.sh
Last active July 21, 2022 07:18
readme_context.md
for context in Personal InterfaceWith Healthify HP FP EnjoyBy Delegated2 DailyDo DRAMAL ; do tc $context; tp > readme_$context.md; tt>readme_$context.md; ts >> readme_$context.md; tcn; echo $context; done
@suchoudh
suchoudh / gist:7527cb15336b4799f2b839fcdbaa5b41
Created February 27, 2023 05:28
usings options in a bash script for BoD and EoD processes
#!/bin/bash
usage() { echo "$0 usage:" && grep " .)\ #" $0; exit 0; }
[ $# -eq 0 ] && usage
while getopts ":hs:b:e:" arg; do
case $arg in
b) # Specify b value.
echo "runningBoD is ${OPTARG}"
./BoD.sh
;;
e) # Specify e value.
@suchoudh
suchoudh / gist:cb038052e94924c00b8c717924a73a3b
Created May 29, 2023 07:51
add prefix or suffix to all files in a folder (including folders)
ls | xargs -I {} mv {} PRE_{}
ls | xargs -I {} mv {} {}_SUF
# can use filering with ls in $0
@suchoudh
suchoudh / main.rs
Created April 4, 2024 07:22 — forked from antuneza/main.rs
One Billion Row Challenge, Part I: The Basics
use std::collections::{BTreeMap};
use std::fs::File;
use std::io::{self, BufRead, Read, Seek, SeekFrom};
use std::ops::AddAssign;
use fnv::FnvHashMap;
#[derive(Debug, Clone, Copy)]
struct TemperatureStats {
min: f32,
max: f32,
@suchoudh
suchoudh / decimalsPercentageCalculation.sh
Created April 27, 2024 09:34
time left % calculation
echo Predicted is $PREDICTED
COUNTER=0
PREDICTED=$1
PREDICTED="${PREDICTED:=12}"
TEST="$(($PREDICTED*60))"
while true
do
echo test is $TEST
COUNTER=$((COUNTER+1))