Skip to content

Instantly share code, notes, and snippets.

View alan-morey's full-sized avatar

Alan Morey alan-morey

View GitHub Profile
@alan-morey
alan-morey / AnonApp.cls
Last active January 8, 2016 23:58
Wrapper for running anonymous code blocks in Salesforce, print() and println() allow you to write messages to a single output stream and have the out rendered to debug log and also in an AlertException. The AlertException is the always thrown at end of execution which ensures that nothing is ever committed to the Database.
public abstract class AnonApp implements MainMethod {
final String[] OUT = new String[0];
public static void run(Type clazz) {
AnonApp app = (AnonApp) clazz.newInstance();
app.run();
}
public void run() {
try {
class SetupAuditTrails {
public Map<String, Set<String>> getModifiedClassesSince(Id sinceTrailId) {
return getModifiedClassesSince(sinceDate(sinceTrailId));
}
public Map<String, Set<String>> getModifiedClassesSince(DateTime sinceDate) {
Map<String, Set<String>> changes = new Map<String, Set<String>>();
for (SetupAuditTrail t : [
SELECT display
@alan-morey
alan-morey / keybase.md
Created October 20, 2017 21:33
keybase.md

Keybase proof

I hereby claim:

  • I am alan-morey on github.
  • I am alanmorey (https://keybase.io/alanmorey) on keybase.
  • I have a public key ASC_PfYGuMi76Hro7GXR8FQJowknG2Za0s0RWmEZaELM3wo

To claim this, I am signing this object:

@alan-morey
alan-morey / XmlStarlet.txt
Last active October 30, 2017 17:08
XmlStarlet
Salesforce package.xml
xmlstarlet sel -t -m _:Package/_:types -s A:T:U _:name -n -v _:name -n -m _:members -s A:T:U . -v "concat(' - ', .)" -n package.xml
xmlstarlet sel -t -m _:Package/_:types -s A:T:U _:name -m _:members -s A:T:U . -v "concat(../_:name, '::', .)" -n package.xml