Skip to content

Instantly share code, notes, and snippets.

View hamidKMB's full-sized avatar
🚀
Getting Ready

hamid kamyab hamidKMB

🚀
Getting Ready
View GitHub Profile
@hamidKMB
hamidKMB / gist:7f59ce9dd4d0d0b51b95a2424a050f65
Last active January 13, 2022 10:37
Refresh Page One Time on React JS
const reloadCount = sessionStorage.getItem('reloadCount');
if (reloadCount < 1) {
sessionStorage.setItem('reloadCount', String(reloadCount + 1));
window.location.reload();
} else {
sessionStorage.removeItem('reloadCount');
}
@hamidKMB
hamidKMB / ImageOnConsole.js
Created December 1, 2021 14:52
Put Image on Console
console.log(
'%c ',
'background-size: 20px 20px; background: url(https://salmatrip.ir/images/Group.png); padding: 100px 100px; background-repeat: no-repeat ',
);
@hamidKMB
hamidKMB / Index(Leap-Year).js
Created March 3, 2021 13:28
Leap Year Checking
//Leap year
function leapYear(year){
if ( year % 4 == 0 ){
if( year % 100 == 0){
if( year % 400 == 0 ){
return "IS Leap Year";
} else {
return"NOT Leap Year";
@hamidKMB
hamidKMB / index(BMI).js
Created March 3, 2021 12:44
BMI Calculator With Calculating How much Weight you must Loose or Gain
//Calculating the BMI
function BMI(weight , height){
var calcBmi = (weight/(height**2));
return Math.floor(calcBmi*10)/10;
}