Skip to content

Instantly share code, notes, and snippets.

View geekyakshay's full-sized avatar
🎯
EA Hackathon

Akshay Poddar geekyakshay

🎯
EA Hackathon
View GitHub Profile
@geekyakshay
geekyakshay / isValidSfId.js
Created March 14, 2023 07:10 — forked from step307/isValidSfId.js
Javascript check salesforce id validity
function isValidSfId(str) {
// https://stackoverflow.com/a/29299786/1333724
if (typeof str !== 'string' || str.length !== 18) {
return false;
}
let upperCaseToBit = (char) => char.match(/[A-Z]/) ? '1' : '0';
let binaryToSymbol = (digit) => digit <= 25 ? String.fromCharCode(digit + 65) : String.fromCharCode(digit - 26 + 48);
let parts = [
@geekyakshay
geekyakshay / customRichTextOutput.html
Created June 29, 2020 15:20
Display Rich Text Contents in lightning-datatable column in LWC
<template>
<p class="slds-truncate slds-p-horizontal_x-small" title={value}>
<lightning-formatted-rich-text value={value} ></lightning-formatted-rich-text>
</p>
</template>
@geekyakshay
geekyakshay / customIconOutput.css
Created June 29, 2020 15:15
Custom Icons or Image as column in lightning-datatable LWC
.image
{
height: 1.5rem;
width: auto;
}
@geekyakshay
geekyakshay / app.html
Last active March 7, 2024 17:58
Implement custom columns in lightning-datatable LWC
<template>
<!-- Embed custom datatable component in your parent component -->
<c-custom-datatable
key-field="Id"
data={toggleExampleData}
hide-checkbox-column
columns={toggleExampleColumns}
onselectedrec={handleSelectedRec}>
</c-custom-datatable>
</template>
@geekyakshay
geekyakshay / app.html
Last active June 12, 2023 07:58
Custom stencil implementation using Lightning Web Component. Two sample stencil structure provided as templates. Supported types are feed and list.
<template>
<!-- Embed stencil component in your parent component -->
<c-stencil iterations="4" type="feed" columns="2"></c-stencil>
<c-stencil iterations="4" columns="2"></c-stencil>
</template>