Skip to content

Instantly share code, notes, and snippets.

View asifvora's full-sized avatar
🇮🇳
Life is Journey Not a Destination.

Asif Vora asifvora

🇮🇳
Life is Journey Not a Destination.
View GitHub Profile
@asifvora
asifvora / grouped by dates
Created January 4, 2019 12:59
grouped by dates
groupedDates(dates) {
let groupedDates = dates.reduce((l, r) => {
let date = r.OppEvents.DueDate;
let parseDate = new Date(Date.parse(date));
let d = parseDate;
let dd = d.getDate();
let mm = d.getMonth() + 1; //January is 0!
let yyyy = d.getFullYear();
var key = yyyy + dd + mm;
if (typeof l[key] === "undefined") {
@asifvora
asifvora / toggle_switch.html
Created March 15, 2019 05:14
Creates a toggle switch with CSS only.
<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 / circle.html
Created March 15, 2019 05:19
Creates a circle shape with pure CSS.
<style>
.circle {
border-radius: 50%;
width: 2rem;
height: 2rem;
background: #333;
}
</style>
<div class="circle"></div>
@asifvora
asifvora / counter.html
Created March 15, 2019 05:21
Counters are, in essence, variables maintained by CSS whose values may be incremented by CSS rules to track how many times they're used.
<style>
ul {
counter-reset: counter;
}
li::before {
counter-increment: counter;
content: counters(counter, '.') ' ';
}
</style>
<ul>
@asifvora
asifvora / custom_text_selection.html
Created March 15, 2019 05:23
Custom text selection changes the styling of text selection.
<style>
::selection {
background: aquamarine;
color: black;
}
.custom-text-selection::selection {
background: deeppink;
color: white;
}
</style>
@asifvora
asifvora / donut_spinner.html
Created March 15, 2019 05:31
Donut spinner : Creates a donut spinner that can be used to indicate the loading of content.
<style>
@keyframes donut-spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
.donut {
@asifvora
asifvora / masks.js
Created March 15, 2019 05:44
Create a function that masks a string of characters with # except for the last four (4) characters.
const mask = (str, maskChar = "#") => str.slice(-4).padStart(str.length, maskChar);
mask("123456789"); // "#####6789"
@asifvora
asifvora / api models Locations.js
Created November 29, 2017 07:52 — forked from juanpasolano/api models Locations.js
seed database on sails js
/**
* Locations.js
*
* @description :: TODO: You might write a short summary of how this model works and what it represents here.
* @docs :: http://sailsjs.org/#!documentation/models
*/
module.exports = {
seedData:[
client ID : 645687027098-rmibrne0gsdg0vpv7fo3fpdbkjoar0us.apps.googleusercontent.com
client secret : kEoPZ7XemhQEtvBaXKtgFVSW