Skip to content

Instantly share code, notes, and snippets.

View kurunve's full-sized avatar

Volodymyr Antoniuk kurunve

View GitHub Profile
@Oblongmana
Oblongmana / .gitignore-sf
Last active August 4, 2023 08:24
Salesforce development gitignore file. Specific to a Sublime Text/MavensMate/OSX setup, used @TrineoLtd.Works well with this git alias for speeding up repo setup https://gist.github.com/Oblongmana/7145945. Curl with curl -o .gitignore https://gist.github.com/Oblongmana/7130387/raw/69aa9b661b0bd7300eff8648c65362c7f711f725/.gitignore-sf
#OSX-specific exclusions
.[dD][sS]_[sS]tore
#Sublime nature exclusions
*.sublime-workspace
*.sublime-project
#MavensMate nature exclusions
config/*
mm.log
@gbutt
gbutt / ScheduledDispatcher.cls
Last active February 6, 2022 15:24
apex scheduled dispatcher - this is how you can schedule code in SFDC without locking up all your classes
/***
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 ScheduledDispatcher.IScheduleDispatched
2) Create a new instance of ScheduledDispatcher with the type of your new class.
3) Schedule the ScheduledDispatcher instead of directly scheduling your new class.
See ScheduledRenewalsHandler for a working example.
@brianmfear
brianmfear / AWS.apxc
Last active February 3, 2022 09:47
AWS SQS Methods, in Apex Code.
public abstract class AWS {
// Post initialization logic (after constructor, before call)
protected abstract void init();
// XML Node utility methods that will help read elements
public static Boolean getChildNodeBoolean(Dom.XmlNode node, String ns, String name) {
try {
return Boolean.valueOf(node.getChildElement(name, ns).getText());
} catch(Exception e) {
return null;
@mattandneil
mattandneil / build.xml
Last active November 14, 2022 18:18
Salesforce Organization Destroy - Ant Script
<macrodef name="destroy" description="Destroys all metadata in an organization - Revision 23">
<attribute name="username" />
<attribute name="password" />
<attribute name="serverurl" default="https://login.salesforce.com" />
<attribute name="tempDir" default="temp/destroy" description="Directory to write metadata." />
<attribute name="apiVersion" default="43.0" />
<sequential>
@aptkdev
aptkdev / ApexFileUpload.cls
Created February 15, 2018 11:54
Apex File File Upload (Using ContentVersion)
/*
* @class FileUploaderClass
* @desc Lets you uplaod a file in Salesforce by giving a base64 string of the
* file, a name for the file, and the Id of the record that you want to attach
* the file to.
*
* @example:
* FileUploaderClass.uploadFile(myBase64String, 'Invoice.pdf', '906F0000000kG2UIAU')
*/
public class FileUploaderClass {