Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Shubham Prakash iShubhamPrakash

🏠
Working from home
View GitHub Profile
@iShubhamPrakash
iShubhamPrakash / add_two_times.js
Created October 21, 2022 02:46 — forked from joseluisq/add_two_times.js
Add two string time values (HH:mm:ss) with javascript
View add_two_times.js
/**
* Add two string time values (HH:mm:ss) with javascript
*
* Usage:
* > addTimes('04:20:10', '21:15:10');
* > "25:35:20"
* > addTimes('04:35:10', '21:35:10');
* > "26:10:20"
* > addTimes('30:59', '17:10');
* > "48:09:00"
@iShubhamPrakash
iShubhamPrakash / LoadingIndicator.js
Last active December 29, 2021 07:07
A custom React+tailwind loading indicator
View LoadingIndicator.js
/**
* Author: https://shubhamprakash.dev
* Description: This is a custom LoadingIndicator component that can be used in any React project with Tailwind css.
**/
import React, { useEffect, useRef, useState } from "react";
import PropTypes from "prop-types";
export const LoadingIndicator = ({ show, color, progress, height }) => {
const [width, setWidth] = useState(0);
@iShubhamPrakash
iShubhamPrakash / downloadImages.sh
Created April 14, 2021 07:24
A simple script to download all the images whose links are stored in an array.
View downloadImages.sh
#!/bin/bash
# A simple script to download all the images whose links are stored in an array.
echo "Download start:"
declare -a image_array=("https://storage.googleapis.com/tfk_assets/Images/01-category.jpg" "https://storage.googleapis.com/tfk_assets/Images/02-category.jpg" "https://storage.googleapis.com/tfk_assets/Images/05-category.jpg" "https://storage.googleapis.com/tfk_assets/Images/06-category.jpg" "https://storage.googleapis.com/tfk_assets/Images/08-category.jpg" "https://storage.googleapis.com/tfk_assets/Images/09-category.jpg" "https://storage.googleapis.com/tfk_assets/Images/10-category.jpg" "https://storage.googleapis.com/tfk_assets/Images/20-category.jpg" "https://storage.googleapis.com/tfk_assets/Images/21-category.jpg")