Skip to content

Instantly share code, notes, and snippets.

🇮🇳
Life is Journey Not a Destination.

Asif Vora asifvora

🇮🇳
Life is Journey Not a Destination.
Block or report user

Report or block asifvora

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:711568333f8235cd5a07d518faa28972
client ID : 645687027098-rmibrne0gsdg0vpv7fo3fpdbkjoar0us.apps.googleusercontent.com
client secret : kEoPZ7XemhQEtvBaXKtgFVSW
@asifvora
asifvora / recursion.js
Created Mar 15, 2019
Recursion JavaScript
View recursion.js
const nest = (items, id = null, link = "parent_id") =>
items
.filter(item => item[link] === id)
.map(item => ({ ...item, children: nest(items, item.id) }))
const comments = [
{ id: 1, parent_id: null, text: "First reply to post." },
{ id: 2, parent_id: 1, text: "First reply to comment #1." },
{ id: 3, parent_id: 1, text: "Second reply to comment #1." },
{ id: 4, parent_id: 3, text: "First reply to comment #3." },
@asifvora
asifvora / masks.js
Created Mar 15, 2019
Create a function that masks a string of characters with # except for the last four (4) characters.
View masks.js
const mask = (str, maskChar = "#") => str.slice(-4).padStart(str.length, maskChar);
mask("123456789"); // "#####6789"
@asifvora
asifvora / donut_spinner.html
Created Mar 15, 2019
Donut spinner : Creates a donut spinner that can be used to indicate the loading of content.
View donut_spinner.html
<style>
@keyframes donut-spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
.donut {
@asifvora
asifvora / custom_text_selection.html
Created Mar 15, 2019
Custom text selection changes the styling of text selection.
View custom_text_selection.html
<style>
::selection {
background: aquamarine;
color: black;
}
.custom-text-selection::selection {
background: deeppink;
color: white;
}
</style>
@asifvora
asifvora / counter.html
Created Mar 15, 2019
Counters are, in essence, variables maintained by CSS whose values may be incremented by CSS rules to track how many times they're used.
View counter.html
<style>
ul {
counter-reset: counter;
}
li::before {
counter-increment: counter;
content: counters(counter, '.') ' ';
}
</style>
<ul>
@asifvora
asifvora / circle.html
Created Mar 15, 2019
Creates a circle shape with pure CSS.
View circle.html
<style>
.circle {
border-radius: 50%;
width: 2rem;
height: 2rem;
background: #333;
}
</style>
<div class="circle"></div>
@asifvora
asifvora / toggle_switch.html
Created Mar 15, 2019
Creates a toggle switch with CSS only.
View toggle_switch.html
<style>
.switch {
position: relative;
display: inline-block;
width: 40px;
height: 20px;
background-color: rgba(0, 0, 0, 0.25);
border-radius: 20px;
transition: all 0.3s;
}
@asifvora
asifvora / instagram-follow-script.js
Last active Aug 13, 2019
Async/Await Essentials for Production: Loops
View instagram-follow-script.js
const timeoutPromise = (timeout) => new Promise((resolve) => setTimeout(resolve, timeout));
const list = document.querySelectorAll('.L3NKy');
function clikOnLink(link){
link.click();
}
const asyncLoop = async () => {
for (let i = 0; i < list.length ; i++) {
await timeoutPromise(1000);
You can’t perform that action at this time.