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
| /* | |
| ====================================================================== | |
| The following apex code demonstrates logging into another salesforce | |
| org via the SOAP/XML web service api and then using session id to | |
| query the standard REST API as well as the Chatter REST API. | |
| To run this code, simply copy and paste into execute anonymous, | |
| then replace the value of the first three variables accordingly. | |
| NOTES: | |
| (1) You'll need to create a remote site setting for both the login |
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
| #!/bin/bash | |
| # Sometimes you need to move your existing git repository | |
| # to a new remote repository (/new remote origin). | |
| # Here are a simple and quick steps that does exactly this. | |
| # | |
| # Let's assume we call "old repo" the repository you wish | |
| # to move, and "new repo" the one you wish to move to. | |
| # | |
| ### Step 1. Make sure you have a local copy of all "old repo" | |
| ### branches and tags. |
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
| Apex Code: | |
| HttpRequest req = new HttpRequest(); | |
| req.setHeader('Authorization', 'Bearer ' + UserInfo.getSessionID()); | |
| req.setHeader('Content-Type', 'application/json'); | |
| String domainUrl=URL.getSalesforceBaseUrl().toExternalForm(); | |
| system.debug('********domainUrl:'+domainUrl); | |
| req.setEndpoint(domainUrl+'/services/data/v28.0/tooling/query/?q=Select+id,DeveloperName,Sharingmodel,NamespacePrefix+from+CustomObject'); | |
| req.setMethod('GET'); |
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
| // check version | |
| node -v || node --version | |
| // list locally installed versions of node | |
| nvm ls | |
| // list remove available versions of node | |
| nvm ls-remote | |
| // install specific version of node |
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
| ---- install Oracle JDK 1.8 | |
| $ wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u141-b15/336fa29ff2bb4ef291e347e091f7f4a7/jdk-8u141-linux-x64.rpm | |
| $sudo yum install -y jdk-8u141-linux-x64.rpm | |
| ---- install OpenJDK | |
| $ vi install.sh | |
| yum install -y java-1.8.0-openjdk-devel | |
| yum remove java-1.7.0-openjdk | |
| wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo |
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
| <macrodef name="snapshot" description="Snapshots all metadata in an organization - Revision 22"> | |
| <attribute name="username" /> | |
| <attribute name="password" /> | |
| <attribute name="serverurl" default="https://login.salesforce.com" /> | |
| <attribute name="outPath" default="temp/snapshot" description="Directory to write snapshot." /> | |
| <sequential> | |
| <!-- prompt user to confirm --> |
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
| public class PageController { | |
| // Transient so we don't exceed view state limits | |
| public transient String fileType { get; set; } | |
| public transient Blob fileBody { get; set; } | |
| ApexPages.StandardController controller; | |
| public PageController(ApexPages.StandardController controller) { | |
| this.controller = controller; | |
| } |
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
| <aura:application extends="force:slds" controller="AccountListFilterByCity"> | |
| <aura:attribute name="cities" type="List" default="[]" /> | |
| <aura:attribute name="allAccounts" type="List" default="[]" /> | |
| <aura:attribute name="filterAccounts" type="List" default="[]" /> | |
| <aura:handler name="init" value="{!this}" action="{!c.init}" /> | |
| <lightning:layout> | |
| <lightning:layoutItem size="3"> | |
| <aura:iteration items="{!v.cities}" var="cityValue"> |
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
| public class TreeNodeDataProvider { | |
| @AuraEnabled public static User[] getUsers() { | |
| return [SELECT Name, ManagerId, SmallPhotoUrl FROM User]; | |
| } | |
| } |
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
| // Help report errors to parent/child object on failed DML update | |
| // For use in Trigger contexts only. | |
| // This version is for demonstration purposes only, and should not | |
| // be considered production ready without additional modifications. | |
| // | |
| // Example trigger: | |
| // | |
| // trigger updateContactPhone on Account(after update) { | |
| // Id[] updates = new Id[0]; | |
| // for(Account record: Trigger.new) { |
OlderNewer