Skip to content

Instantly share code, notes, and snippets.

View cnaccio's full-sized avatar

Charles Naccio cnaccio

View GitHub Profile
@cnaccio
cnaccio / TestsUtils.cls
Created May 30, 2023 00:45
AccountingSeed Test Data Helper Class [just execute TestsUtils.setupAccountingSeedTestData()]
public with sharing class TestsUtils {
// Setup global/account data
public static void setupAccountingSeedTestData() {
User adminUser = TestsUtils.getAdminUser();
System.runAs(adminUser) {
TestsUtils.createAccountingSettings();
}
}
@cnaccio
cnaccio / trading-algorithms.csproj
Created November 26, 2020 20:01
.csproj for enabling QuantConnect autcomplete for CSharp algorithms
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<ItemGroup>
<Compile Include=".\**\*.cs*" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\lean\Common\QuantConnect.csproj" />
<ProjectReference Include="..\lean\Indicators\QuantConnect.Indicators.csproj" />
<ProjectReference Include="..\lean\Algorithm\QuantConnect.Algorithm.csproj" />
@cnaccio
cnaccio / 1. pattern_SecureDML.cls
Last active April 18, 2021 18:33
Salesforce Apex CRUD/Field Level Security Implementation for DML Operations (needed to pass security review) [Note that this code leverages the fflib commons library and concepts from the DMLManager library]
/**
* @author Charles Naccio
* @date 5/31/2019
*
* @group Security
* @group-content ../../ApexDocContent/Security.htm
*
* @description A unit of work DML interface for executing secure database write operations
* based on user level permissions.
*/
@cnaccio
cnaccio / Salesforce Lightning Component Quick Action Modal
Created October 19, 2017 16:42
Recreation of the quick action modal with header and footer to give you control over the quick action buttons. Enjoy!
<aura:component implements="flexipage:availableForRecordHome,force:hasRecordId,force:lightningQuickActionWithoutHeader"
access="global">
<!-- modal size fix -->
<style type="text/css">
.cFulfillmentReceivePurchaseOrder.slds-modal__container {width:100%;padding:0;margin:0;}
.cFulfillmentReceivePurchaseOrder .slds-modal__content {padding:1rem;}
.slds-modal__content {padding:0;height:auto !important;max-height:100% !important;}
.forceChatterBasePublisher :not(.PHONE) .cuf-content {padding:0;}
</style>
@cnaccio
cnaccio / apexdoc-class.sublime-snippet
Last active August 29, 2015 14:27
ApexDoc Comment Sublime Snippets
<snippet>
<content>
<![CDATA[
/**
* @author Charles Naccio
* @date ${1:DD}/${2:MM}/20${3:YY}
*
* @group ${4:a group to display this class under, in the menu hierarchy. i.e. "Payment Processing"}
* @group-content ${5:a relative path to a static html file that provides content about the group i.e. "../../ApexDocContent/Accounts.htm"}
*

/node_modules/x-ray-html/index.js

/**
* Module Dependencies
*/

// Any module dependencies go here

/**
* Export the default `driver`