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
[...Array(10).keys()] | |
//=> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] |
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
{ | |
"folders": [ | |
{ | |
"path": "C:\\Github\\PROJECT_NAME" | |
} | |
], | |
"settings": { | |
"workbench.colorCustomizations": { | |
"titleBar.activeBackground": "#141415", | |
"titleBar.activeForeground": "#FFC87F", |
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
// Encryption/decryption of an object | |
let encrypted = await encrypt( | |
{ a: 0, b: 1, c: true, d: 'foobar' }, | |
SUPER_SECRET_PASSPHRASE | |
); | |
console.log(encrypted); | |
// => '["bkvTkQNfTfnP7uUirivktij4iy66pSbiBDYJ3uNChkIlDJPBdkJ4Tqbe98a+QSujoHME",[2,0,0,0,0,0,0,0]]' | |
let decrypted = await decrypt(encrypted, SUPER_SECRET_PASSPHRASE); | |
console.log(decrypted); |
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
ConnectApi.CommunityPage queryAllTheCommunities = ConnectApi.Communities.getCommunities(); | |
System.debug('queryAllTheCommunities ' + queryAllTheCommunities.communities); | |
for (ConnectApi.Community community : queryAllTheCommunities.communities) { | |
System.debug('--------------------------------------------------'); | |
System.debug('id ' + community.id); | |
System.debug('name ' + community.name); | |
System.debug('description ' + community.description); | |
System.debug('siteUrl ' + community.siteUrl); // https://your-salesforce-sites-url.cs46.force.com/custom_site | |
System.debug('url ' + community.url); // /services/data/v48.0/connect/communities/0DB9A0000003eW9LWC |
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<Account> listOfAccounts = [ SELECT Id, Name, ShippingLongitude, ShippingLatitude FROM Account WHERE ShippingLatitude != NULL]; | |
Location userLocation = Location.newInstance(-35.4330529, 149.0699176); | |
System.debug('a userLocation ' + userLocation); | |
for (Account account : listOfAccounts) { | |
Location placeLocation = Location.newInstance(account.ShippingLatitude, account.ShippingLongitude); | |
Double distanceBetween = Location.getDistance(userLocation, placeLocation, 'km'); | |
System.debug('Distance Between ' + distanceBetween + 'km'); | |
} |
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
curl https://raw.githubusercontent.com/benniemosher/the-one-theme/master/zsh/TheOne.zsh-theme --create-dirs -o ~/.zsh-plugins/the-one-theme/TheOne.zsh-theme | |
source ~/.zsh-plugins/the-one-theme/TheOne.zsh-theme | |
source ~/.zshrc |
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
sfdx force:mdapi:deploy -d src -u ORG_ALIAS -w 10 |
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
C:\Program Files (x86)\Google\Chrome\Application\chrome.exe --allow-running-insecure-content |
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
let now = new Date() | |
let yr = now.getFullYear() | |
let mth = `${ | |
now.getMonth() + 1 < 10 ? `0${now.getMonth() + 1}` : now.getMonth() + 1 | |
}` | |
let dt = `${date.getDate() < 10 ? `0${date.getDate()}` : date.getDate()}` | |
let hrs = `${ | |
date.getHours() < 10 ? `0${date.getHours()}` : date.getHours() | |
}` | |
let mins = `${ |
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 endpoint = URL.getSalesforceBaseUrl().toExternalForm()+'/services/data/v47.0/sobjects/NetworkMemberGroup'; | |
HttpRequest httpRequest = new HttpRequest(); | |
httpRequest.setEndpoint(endpoint); | |
httpRequest.setMethod('POST'); | |
httpRequest.setHeader('Authorization', 'Bearer ' + UserInfo.getSessionID()); | |
httpRequest.setHeader('Content-Type', 'application/json;charset=UTF-8'); | |
// Change network id and profile/permission set Id | |
httpRequest.setBody('{"NetworkId":"0DBB00000004d57","ParentId":"00eB0000000fegYIAQ"}'); | |
Http http = new Http(); |
OlderNewer