This file contains 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
String extFileUrl = 'https://images.unsplash.com/photo-1592746455916-7ac99236b6d6?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=634&q=80'; | |
Http h = new Http(); | |
HttpRequest req = new HttpRequest(); | |
// Replace any spaces in extFileUrl with %20 | |
extFileUrl = extFileUrl.replace(' ', '%20'); | |
// Set the end point URL | |
req.setEndpoint(extFileUrl); | |
req.setMethod('GET'); |
This file contains 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
/* Allows devs to see errors that probably should be logged to the console but aren't */ | |
.auraErrorBox { | |
width: 100%; | |
} | |
.auraErrorBox > span { | |
display: flex; | |
align-items: center; | |
font-weight: 700; | |
margin-bottom: 8px; | |
} |
This file contains 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
/** | |
* Retrieve URL params from the url | |
*/ | |
export const getUrlParams = (search = window.location.search) => { | |
return [...new URLSearchParams(search).entries()].reduce( | |
(acc, [key, value]) => { | |
const _value = decodeURIComponent(value) | |
return { | |
...acc, | |
[key]: _value !== 'null' && _value !== 'undefined' ? _value : undefined, |
This file contains 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 getSfSessionStorage() { | |
let sfSessionStorage = {}; | |
// find the sessionStorage key that hold the SF data | |
Object.keys(sessionStorage).forEach((key) => { | |
if (key.includes('namespace')) { | |
sfSessionStorage = JSON.parse(sessionStorage[key]); | |
} | |
}); |
This file contains 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
{ | |
"search.exclude": { | |
"**/.localdevserver": true, | |
"**/.sfdx": true, | |
"**/node_modules": true, | |
"force-app\\main\\default\\aura": false, | |
"force-app\\main\\default\\classes": false, | |
"force-app\\main\\default\\lwc": false, | |
"force-app\\main\\default\\pages": false, | |
"force-app\\main\\default\\staticresources": true |
This file contains 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
for /r %d in (*) do copy "%d" "C:\Documents\PATH\TO\SOURCE" |
This file contains 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
Long dt1Long = DateTime.now().addDays(-1).getTime(); | |
Long dt2Long = DateTime.now().getTime(); | |
Long milliseconds = dt2Long - dt1Long; | |
Long seconds = milliseconds / 1000; | |
Long minutes = seconds / 60; | |
Long hours = minutes / 60; | |
Long days = hours / 24; |
This file contains 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
Datetime.valueOfGmt(String.valueOf(Datetime.now())); |
This file contains 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
List<PicklistEntry> fields = Account.SObjectType.getDescribe().fields.getMap().get('Type').getDescribe().getPicklistValues(); | |
for (PicklistEntry picklistEntry : fields) { | |
System.debug(picklistEntry.getLabel() + ' with value: ' + picklistEntry.getValue()); | |
} |
This file contains 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
[ | |
{ | |
"code": "PUB", | |
"label": "Australian Public Company" | |
}, | |
{ | |
"code": "PRV", | |
"label": "Australian Private Company" | |
}, | |
{ |