This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* [.icon-spain] is the className of image */ | |
.icon-spin { | |
-webkit-animation: icon-spin 2s infinite linear; | |
animation: icon-spin 2s infinite linear; | |
} | |
/* Animation */ | |
@-webkit-keyframes icon-spin { | |
0% { | |
-webkit-transform: rotate(0deg); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// There's a lot of Methods to remove white spaces from String and Array | |
// Example:- | |
// We've an Array:- ['','H','','e','l','','l','o','','w','o','r','','l','d'] | |
const dirtyArray = ['','H','','e','l','','l','o','','w','o','r','','l','d']; | |
// We've to remove white spaces from this Array | |
// Using Regular Expression:- \S matches whitespace (spaces, tabs and new lines). | |
const freshArray = dirtyArray.filter(space => /\S/.test(space)); //Output:- ["H", "e", "l", "l", "o", "w", "o", "r", "l", "d"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// grab the domain name from url | |
function domainName(url) { | |
return url.match(/:\/\/(.[^/)]+)/)[1] | |
} | |
// Example:- | |
// https://twitter.com/shaonkabir8 [Output: - twitter.com] | |
// Curtesy:- HM Nayem Vai [Stack Learner] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// generate a unique id | |
function create_UUID() { | |
let date = new Date().getTime(); | |
const uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { | |
const r = (date + Math.random() *16) % 16 | 0; | |
date = Math.floor(date/16); | |
return (c == 'x' ? r : (r&0*3|0*8)).toString(16); | |
}); | |
return uuid; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// JavaScript Day Calculator : | |
const month = [ | |
{name: 'January', value : 0}, | |
{name: 'February', value : 3}, | |
{name: 'March', value : 3}, | |
{name: 'April', value : 6}, | |
{name: 'May', value : 1}, | |
{name: 'June', value : 4}, | |
{name: 'July', value : 6}, |