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
// format date with time and AM/PM | |
/** | |
* A simple function to convert a date to a human readable string | |
* @param date a date object or a string that can be parsed into a date object | |
* @returns string formatted as "D MMM YYYY, hh:mm am/pm" | |
*/ | |
const getFormattedDate = (date) => { | |
return date.toLocaleString('en-GB', { day: 'numeric', month: 'short', year: 'numeric', hour: 'numeric', minute: 'numeric', hour12: true }) | |
} |
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
Abandon Negative Sentiment | |
Abandoned Negative Sentiment | |
Abandons Negative Sentiment | |
Abducted Negative Sentiment | |
Abduction Negative Sentiment | |
Abductions Negative Sentiment | |
Abhor | |
Abhorred Negative Sentiment | |
Abhorrent Negative Sentiment | |
Abhors |
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
Actually | |
Baby | |
Being | |
Boy | |
Day | |
Dog | |
Down | |
Every | |
First |
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
Absolutely Positive Sentiment | |
Admiration Positive Sentiment | |
Admirer Positive Sentiment | |
Adulation | |
Advice | |
Affordable Positive Sentiment | |
Agony Negative Sentiment | |
Almighty | |
Amour Positive Sentiment | |
Announcing |
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
const uploadImage = async (event) => { | |
let file = event.target.files[0]; | |
const data = await readData(file); | |
let formData = new FormData(); | |
formData.append("file", file); | |
formData.append("upload_preset", "custom-upload"); | |
formData.append("folder", "blog"); | |
const response = await fetch( |
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
<template> | |
<div class="relative my-2"> | |
<input | |
@keyup="findOption()" | |
v-model="optionInput" | |
type="text" | |
class="w-full px-2 py-1 border rounded-t" | |
placeholder="choose category" | |
/> | |
<!-- add an icon on the right --> |
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
<template> | |
<div class="w-full py-3"> | |
<!-- Upload images to cloudinary --> | |
<div class="grid grid-cols-1 gap-2 sm:grid-cols-2 md:grid-cols-3"> | |
<div class="flex items-center justify-center w-full"> | |
<label | |
class="flex flex-col items-center w-full transition-colors border-2 border-gray-300 border-dashed rounded cursor-pointer h-44 hover:bg-gray-200 " | |
:class="[ | |
isUploading |
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
function timeDifference(current, previous) { | |
let msPerMinute = 60 * 1000; | |
let msPerHour = msPerMinute * 60; | |
let msPerDay = msPerHour * 24; | |
let msPerMonth = msPerDay * 30; | |
let msPerYear = msPerDay * 365; | |
let elapsed = current - previous; |
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
<template> | |
<div class="relative max-w-md mx-auto"> | |
<form @submit.prevent="clickHandler"> | |
<input | |
v-model="query" | |
type="text" | |
:placeholder="placeholder" | |
class="w-full px-3 py-3 font-bold text-red-500 border-2 rounded-lg focus:outline-none focus:ring-2 focus:ring-red-500" | |
/> | |
<div class="absolute inset-y-0 right-0"> |
NewerOlder