Skip to content

Instantly share code, notes, and snippets.

@keirbowden
keirbowden / deploy_with_exit_codes.js
Created April 16, 2018 12:39
Node script to execute a deployment and return 0 for success or 1 for failure.
#!/usr/local/bin/node
var fs=require('fs');
var child_process=require('child_process');
var username='keir.bowden@sfdx.deploy';
var deployParams=['force:mdapi:deploy', '-d', 'Orchestrate/src',
'-u', username, '--json'];
@AuraEnabled
static void throwAnException() {
AuraHandledException auraException = new AuraHandledException('The message that displays in Lightning');
auraException.setMessage('The message that you can get in a test');
// If setMessage() is not used, the exception messege won't be present in console (deploys, unit tests, ...)
throw auraException;
}
@IsTest
static void testThrowAnException() {
@sj26
sj26 / LICENSE.md
Last active December 27, 2025 05:35
Bash retry function

This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.

In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit

@jbenet
jbenet / simple-git-branching-model.md
Last active February 26, 2026 00:08
a simple git branching model

a simple git branching model (written in 2013)

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.

@peterknolle
peterknolle / RemotingController.cls
Last active March 6, 2020 21:18
Visualforce Remoting with Relationships
global class RemotingController {
// Assumes two custom objects: Test_Object__c with lookup to Test_Object_2__c
@RemoteAction
global static void UpsertA(Test_Object__c obj1) {
upsert obj1.Test_Object_2__r;
obj1.Test_Object_2__c = obj1.Test_Object_2__r.Id;
upsert obj1;
}