Skip to content

Instantly share code, notes, and snippets.

View tet3's full-sized avatar

Thomas Taylor tet3

  • Philadelphia, PA
  • X @tet3
View GitHub Profile
@tet3
tet3 / HttpMockRegistry.cls
Created July 29, 2022 18:03 — forked from SpenceDiNicolantonio/HttpMockRegistry.cls
[More Robust Mocking in Apex] A dynamic HTTP mock registry and a configurable Stub class to simplify and enhance mocking for Apex unit tests #salesforce #apex
/**
* A registry built around the Salesforce Mocking API that allows declarative mocking of HTTP callouts. Mocks responses
* can be registered either for a specific endpoint and path or for all paths on an endpoint, with the former taking
* precedence.
*/
@IsTest
public class HttpMockRegistry {
// Default mock response for HTTP requests
public static final HttpResponse DEFAULT_MOCK_RESPONSE = createSuccessResponse('Default mock response');
@tet3
tet3 / 3x cores, 4GB RAM
Created May 2, 2020 19:47
nench.sh (https://github.com/n-st/nench) results from racknerd
-------------------------------------------------
nench.sh v2019.07.20 -- https://git.io/nench.sh
benchmark timestamp: 2020-05-02 19:42:08 UTC
-------------------------------------------------
Processor: Intel(R) Xeon(R) CPU E5-2690 0 @ 2.90GHz
CPU cores: 3
Frequency: 2899.996 MHz
RAM: 3.9G
Swap: 4.0G

Keybase proof

I hereby claim:

  • I am tet3 on github.
  • I am tet3 (https://keybase.io/tet3) on keybase.
  • I have a public key ASDvVHooB8UbjxjtoRFNVgUS_qNa-m7In2lkYL0cnwh5gwo

To claim this, I am signing this object:

version: "2.1"
services:
grocy:
image: linuxserver/grocy
container_name: grocy
environment:
- PUID=1000
- PGID=1000
- TZ=America/New_York
labels:
Two young boys, who lived next door to one another, grew up as best friends. But when they reached their teens, their paths began to diverge. Frank Sam was studious, church-going and often seen helping old ladies to cross the street. Sam Frank, on the other hand, drove his car too fast, drank a bit on the weekends, and could always be found on Friday night smoking cigarettes and wolf-whistling at the girls in the convenience store parking lot. Driving home from the convenience store one night with his suspiciously cylindrical brown paper bag in hand, he passed Frank Sam walking home from his job at the local drugstore. Filled momentarily with nostalgia and a bit of regret, he stopped, waited for Frank to catch up, and then offered him a ride. Frank readily agreed, and as they drove, they started talking just as they had done as boys. The conversation and alcohol caused Sam Frank to lose concentration, however, and he drove them into a tree, killing both immediately. They ascended to the Pearly Gates, where St
@tet3
tet3 / TaskMailMergeTrigger.trigger
Last active June 27, 2019 21:03
Mail Merge ID finding Task trigger
trigger TaskMailMergeTrigger on Task (before insert) {
//Assumes "Mail Merge ID: " *with the space* is always on the line before
//the ID, which is all numbers
Pattern mmID = Pattern.compile('Mail Merge ID: ([0-9]+)');
for (Task t : trigger.new) {
Matcher mTask = mmID.matcher(t.Description);
if (mTask.find()) {
//Assumes you have a text field, Mail_Merge_ID__c, on the Activity object
@tet3
tet3 / email.md
Last active June 18, 2019 19:44
figuring our how to escape email address
IF(TEXT(Next_Refinement_Kit_Action__c) = "AWAIT Refinement PHOTOS","Photo Stage",
IF(OR(
ISPICKVAL(Next_Refinement_Action__c,"PATIENT REQUESTS REFINEMENTS"),
ISPICKVAL(Next_Refinement_Action__c,"SEND REFINEMENT PHOTOS TO ORTHO")),"Photo Stage",
IF(OR(
TEXT(Next_Refinement_Kit_Action__c) = "AWAIT Refinement KIT",
TEXT(Next_Refinement_Kit_Action__c) = "AWAIT Refinement Redo KIT",
TEXT(Next_Refinement_Kit_Action__c) = "GRADE Refinement PVS",
@tet3
tet3 / CreateAttendances.trigger
Created July 27, 2017 14:43
CreateAttendances trigger sample code for Robin
trigger CreateAttendances on Session__c (after insert) {
Set<Id> programIds = new Set<Id>();
List<Enrollment__c> enrolledMembers = new List<Enrollment__c>();
List<Attendance__c> att = new List<Attendance>();
// create Set of Program IDs we want to query
for (Session__c sessionInLoop : Trigger.new) {
programIds.add(sessionInLoop.Program__c);
}
@tet3
tet3 / findJSHyperlinkFields.apex
Last active September 17, 2017 18:39
Improved version of script to find any HYPERLINK fields with Javascript - debugs a result when no offending fields found. From https://help.salesforce.com/articleView?id=Using-Apex-Code-in-Workbench-to-Find-JavaScript&language=en_US&type=1
// Get all the standard and custom objects in the org
List<EntityDefinition> entityDefs = [select QualifiedApiName from EntityDefinition];
// Forming a list of Entity API names
List<String> entityNames = new List<String>();
for(EntityDefinition entityDef: entityDefs){
if(!entityDef.QualifiedApiName.endsWith('kav')){