How the heck do I set up a scratch org using sfdx? Well, you're in the right place.
This gist has been moved and published here
{ | |
"folders": [ | |
{ | |
"path": "C:\\Github\\PROJECT_NAME" | |
} | |
], | |
"settings": { | |
"workbench.colorCustomizations": { | |
"titleBar.activeBackground": "#141415", | |
"titleBar.activeForeground": "#FFC87F", |
How the heck do I set up a scratch org using sfdx? Well, you're in the right place.
This gist has been moved and published here
/** | |
* 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, |
[...Array(10).keys()] | |
//=> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] |
// 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); |
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'); | |
} |
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 |
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 |
sfdx force:mdapi:deploy -d src -u ORG_ALIAS -w 10 |
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(); |