Skip to content

Instantly share code, notes, and snippets.

View dieffrei's full-sized avatar
🌍
Focusing

Diéffrei Quadros dieffrei

🌍
Focusing
View GitHub Profile
@dieffrei
dieffrei / create-scratch-org.sh
Last active January 19, 2023 19:09
SFDX scratch org creation sample
# create scratch org
sfdx force:org:create -f config/scratch-org-def.json -a $1
# install external dependencies
sfdx force:package:install -u $1 --package 04t3V000000xptbrQAA --apexcompile=package --noprompt --wait 120 --publishwait=60 --securitytype=AdminsOnly --upgradetype=Mixed --apiversion=54.0
sfdx force:package:install -u $1 --package 04t3V000000xptbrEAA --apexcompile=package --noprompt --wait 120 --publishwait=60 --securitytype=AdminsOnly --upgradetype=Mixed --apiversion=54.0
sfdx force:package:install -u --package 04t3V000000xptbrFAA --apexcompile=package --noprompt --wait 120 --publishwait=60 --securitytype=AdminsOnly --upgradetype=Mixed --apiversion=54.0
sfdx force:package:install -u $1 --package 04t3V000000xptbrWAA --apexcompile=package --noprompt --wait 120 --publishwait=60 --securitytype=AdminsOnly --upgradetype=Mixed --apiversion=54.0
sfdx force:package:install -u $1 --package 04t3V000000xptbrBAA --apexcompile=package --noprompt --wait 120 --publishwait=60 --securitytype=AdminsOnly --upgradetyp
FROM circleci/openjdk:latest-node
USER root:root
RUN apt-get update -y; \
apt-get install -y \
libsecret-1-dev;\
mkdir sfdx; \
wget -qO- "https://developer.salesforce.com/media/salesforce-cli/sfdx-linux-amd64.tar.xz" | tar xJ -C sfdx --strip-components 1;\
@dieffrei
dieffrei / manual-actions.md
Created March 24, 2020 10:33
sfdx manual actions

Manual Actions

Manual actions are tasks that can not be automated and should be executed before/after deployment. If your changes are dependent of manual action make sure to commit them with the respective PR.

Date Description Steps
25/02/2020 Create named credentials for magic api TBD
27/02/2020 Update OWD for Lead -> Public Read-Only
27/02/2020 Update OWD for Quote -> Private
@dieffrei
dieffrei / aoe2hd.md
Created December 8, 2019 12:24 — forked from yocontra/aoe2hd.md
Age of Empires II HD - For Mac OSX

AOE2HD - For Mac OSX

Estimated time: 10 minutes

Notice

PlayOnMac does not work on macOS Catalina, and issues have been reported with the latest version of Steam. Updating is in progress, read more here.

When the updates are released this guide will be updated.

@dieffrei
dieffrei / squashing-commits-already-on-remote.sh
Last active December 6, 2019 17:13
Squashing commits already on remote branch
git rebase -i HEAD~10 #number of commits
git push origin +master #name of your branch
public interface IPersonalCustomerApplicationService {
void deactivate(Set<Id> customerIds);
}
class VoidAnswer implements fflib_Answer {
public Object answer(fflib_InvocationOnMock invocation) {
return null;
}
}
@dieffrei
dieffrei / clean_code.md
Created May 27, 2019 10:17 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

/**
* Created by dieffrei on 11/1/18.
*/
global with sharing class SFDBBundleRepository implements BundleRepository {
private MSSBundleSelector bundleSelector;
private MSSBundle_DependencySelector bundleDependencySelector;
private ManagedService_SettingsSelector managedServiceSettingsSelector;
private SkillSelector skillSelector;
@dieffrei
dieffrei / Charset.cls
Created June 5, 2018 19:03 — forked from choose0or7/Charset.cls
Salesforce Force.com Apex: encode and decode string to / from binary characters in charset
public abstract class Charset {
/**
* Convenience method that encodes a string into bytes in charset.
* <p>
* @param input string of Unicode characters
* @param charset name according to http://www.iana.org/assignments/character-sets/character-sets.xhtml
* @return binary characters in charset
*/
public static Blob encode(final String input, final String charset) {
@dieffrei
dieffrei / TargetOrgService.cls
Last active April 21, 2018 17:15
Salesforce Named Credential
public class TargetOrgService {
public class SFEnvelope {
public List<Account> records {get;set;}
}
private static final String ACCOUNTS_SOQL = 'SELECT Id, Name FROM Account LIMIT 10';
public static List<Account> fetchAccounts() {
HttpRequest request = new HttpRequest();