Host bitbucket.org-yourusername
HostName bitbucket.org
User yourusername
IdentityFile ~/.ssh/yoursshkey
IdentitiesOnly yes
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
trigger AccountTrigger on Account( | |
before insert, | |
before update, | |
before delete, | |
after insert, | |
after update, | |
after delete, | |
after undelete | |
) { | |
AccountTriggerHandler objectHandler = new AccountTriggerHandler(Trigger.operationType); |
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
@isTest | |
private class TriggerHandlerTest { | |
// I normally put private classes at the bottom, but to prevent you from having to scroll ... | |
private class TestTriggerHandler extends TriggerHandler { | |
public TriggerOperation Method { get; private set; } | |
@testVisible | |
protected override void beforeInsert(List<SObject> newRecords) { | |
this.Method = TriggerOperation.BEFORE_INSERT; | |
} |
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
public virtual class TriggerHandler { | |
@testVisible | |
private static TriggerOperation triggerContext; | |
protected TriggerHandler() { | |
if (!Trigger.isExecuting && !Test.isRunningTest()) { | |
throw new TriggerHandlerException('TriggerHandler used outside of triggers / testing'); | |
} | |
} |
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
public class AdvancedMath | |
{ | |
public static Double standardDeviation(Double[] numbers) | |
{ | |
//determine the sum of the range of numbers | |
Double sum = 0; | |
for(Double d : numbers) | |
{ | |
sum += d; | |
} |
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
<apex:component layout="none"> | |
<apex:attribute name="statement" | |
description="The Knockout containerless statement to insert." | |
type="String" | |
required="false" | |
/> | |
<apex:attribute name="close" | |
description="Flag that determines whether this is an opening or closing statement for Knockout." | |
type="Boolean" |
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
HYPERLINK( | |
/* If they're in Lightning */ | |
IF($User.UIThemeDisplayed="Theme4d", | |
/* Use Lightning syntax, optimized to avoid full page reload */ | |
"#/sObject/00OE0000003BLQi/view?fv0=", | |
/* Otherwise use Classic syntax */ | |
"/00OE0000003BLQi?pv0=") |
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
angular.module('EventUtil', []) | |
.factory('broadcast', ['$rootScope', function($rootScope){ | |
return function(eventName, payload){ | |
$rootScope.$broadcast(eventName, payload); | |
}; | |
}]) | |
.factory('listen', ['$rootScope', function($rootScope){ | |
return function(eventName, listener){ | |
$rootScope.$on(eventName, listener); | |
}; |
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
/* | |
* Hard coding your Salesforce URL in places like Email Tempaltes and Apex Classes is a worst practice, but some people do it. | |
* These URLs will break when you turn on my domain, since your URL changes. | |
* More on this here: https://help.salesforce.com/apex/HTViewSolution?urlname=Updating-Hard-Coded-References-FAQ | |
* Here are some quick and dirty checks for your Salesforce URL being hard coded in: | |
* EmailTemplates, WebLinks, ApexClasses, Visualforce Pages, and Triggers. | |
* Ideally you would retrieve all metadata and search it, but this will find some of the low hanging problems easily. | |
* | |
* Usage: | |
* - Copy / Paste this into Salesforce Execute Anonymous window. |
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
<apex:outputText value="{0,date,MM'/'dd'/'yyyy}"> | |
<apex:param value="{!task.ActivityDate}" /> | |
</apex:outputText> |
NewerOlder