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 | |
# this function will only rsync files and folders once | |
rsync_unique () { | |
local syncpath=$1 | |
if [[ -d ${syncpath} ]]; then | |
if [[ " ${RSYNED_DIRS[@]} " =~ " ${syncpath} " ]]; then | |
echo "already rsyned ${syncpath}" &> /dev/null | |
else |
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 virtual class EmailBuilder { | |
private static final Logger log = LoggerFactory.getInstance(EmailBuilder.class); | |
@TestVisible | |
public Messaging.SingleEmailMessage email { | |
get; | |
private set; | |
} | |
public EmailBuilder() { |
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
/*** | |
Adapted from the great Dan Appleman. | |
For more on this and many other great patterns - buy his book - http://advancedapex.com/ | |
This class can be used to schedule any scheduled job without risk of locking the class. | |
DO NOT CHANGE THIS CLASS! It is locked by the scheduler. Instead make changes to ScheduledHelper or your own IScheduleDispatched class | |
To use: | |
1) Create a new class to handle your job. This class should implement SchedulableWrapper.IScheduleDispatched | |
2) Create a new instance of SchedulableWrapper with the type of your new class. | |
3) Schedule the SchedulableWrapper instead of directly scheduling your new class. | |
See ScheduledRenewalsHandler for a working example. |
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
// ==UserScript== | |
// @name Redirect to new SFDC release notes | |
// @namespace https://gist.github.com/gbutt/e62c691887887b8287b382455c0194c9 | |
// @version 0.1 | |
// @description Injects a link to new SFDC Release Notes into the old Release Notes page | |
// @author Greg Butt | |
// @match https://releasenotes.docs.salesforce.com/* | |
// @grant none | |
// ==/UserScript== |
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 | |
write_xml () { | |
local type_name="$1" | |
shift | |
local type_arry=("$@") | |
XML="${XML}\n\t<types>\n\t\t<name>${type_name}</name>" | |
for FILENAME in "${type_arry[@]}"; do | |
XML="${XML}\n\t\t<members>${FILENAME}</members>" | |
done |
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 without sharing class Toggles { | |
private static final Map<String, Boolean> TOGGLE_CACHE; | |
static { | |
TOGGLE_CACHE = new Map<String, Boolean>(); | |
loadToggles(); | |
} | |
// temporary toggle - remove after enabled | |
public static Boolean DISABLE_CERT_MEMBERSHIP_EXTENSIONS { |
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:component implements="forceCommunity:availableForAllPageTypes"> | |
<aura:attribute name="label" type="String" required="true" /> | |
<aura:attribute name="flowApiName" type="String" required="true" /> | |
<aura:attribute name="recordId" type="String" /> | |
<aura:attribute name="buttonStretched" type="Boolean" default="true" /> | |
<aura:attribute name="buttonVariant" type="String" required="true" /> | |
<aura:attribute name="buttonPadding" type="String" required="true" /> | |
<aura:attribute name="buttonClasses" type="String" /> | |
<aura:attribute name="overLayModal" type="Object" /> |
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 DependencyResolver { | |
@TestVisible | |
private static Map<Type, Object> cachedDependencies {get; set;} | |
static { | |
cachedDependencies = new Map<Type, Object>(); | |
} | |
// core methods abstract the core logic | |
public static Object getInstance(Type classType) { |
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
@IsTest | |
public class StubProviderImpl implements System.StubProvider { | |
public Type mockType {get; private set;} | |
private Map<String, Object> mockedCalls {get; set;} | |
private Map<String, Exception> mockedExceptions {get; set;} | |
private Map<String, Object[]> callLog {get; set;} | |
public StubProviderImpl(Type mockType) { |
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
@IsTest(IsParallel = true) | |
public class TimezoneTest { | |
@TestSetup | |
static void makeData() { | |
update new User(Id = UserInfo.getUserId(), TimeZoneSidKey = 'America/Denver'); | |
} | |
@IsTest | |
static void it_should_demonstrate_datetime_handling_with_timezones() { |
NewerOlder