This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Get the file path to the language server file provided by Salesforce. | |
local apex_jorje_lsp_file_path = vim.fn.expand("~/Downloads/apex-jorje-lsp.jar") | |
-- Set up the language server configuration for the Apex language, associating | |
-- it with the three main file types by extension, disabling telemetry, and | |
-- specifying the command. | |
require"lspconfig".apex_ls.setup { | |
apex_jar_setup = apex_jorje_lsp_file_path, | |
apex_enable_semantic_errors = false, | |
apex_enable_completion_statistics = false, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am renatoliveira on github. | |
* I am thelavasailor (https://keybase.io/thelavasailor) on keybase. | |
* I have a public key ASCi_4EZpwmK6UrnCFxM7pO72L_xqLu88alhYTzal-cphQo | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MondayApi { | |
@SuppressWarnings('PMD.ApexSuggestUsingNamedCred') | |
public static Map<String, Object> execute(String query) { | |
HttpRequest request = new HttpRequest(); | |
request.setEndpoint('callout:MondayApi'); | |
request.setMethod('POST'); | |
request.setBody(JSON.serialize(new Map<String, Object>{ | |
'query' => query | |
})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 1. Erases permissions from current user | |
// 2. Copies permission set licenses and permission sets from another user. | |
// Rollback available at the end of the script. | |
Savepoint sp = Database.setSavepoint(); | |
String fromUser = '[from username]'; | |
String toUser = '[to username]'; | |
// clean the user |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global class QuotePDFGenerator { | |
@future(callout=true) | |
public static void AttachPDFToQuote(String Id) { | |
try { | |
CreateQuoteDocumentFromPDF(Id); | |
} catch(exception ex) { | |
System.debug('Error: ' + ex); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Import the required libraries | |
# Flask is the web framework for dealing with web stuff (such as serving the app and handling | |
# the connections) We need to import the main "Flask" to run the app, and also its | |
# request and Response method and class to handle the request properly | |
from flask import Flask, Response, request | |
# requests is a simple http request library to handle... requests. | |
import requests | |
# Base64 is a standard module to help us encode/decode Base 64 strings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Permission set's name that I want to assign to all the users | |
String psName = 'PermissionName'; | |
// Query the permission set | |
PermissionSet ps = [ | |
SELECT | |
Id, | |
Label, | |
Name | |
FROM PermissionSet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ComparisonTableController { | |
@AuraEnabled(cacheable=true) | |
public static List<PricebookEntry> getProducts (Id pricebookId, Integer countLimit) { | |
return [ | |
SELECT | |
Id | |
,Product2.Name | |
,Product2.Family | |
,Product2.ProductCode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Considering that 'neutral_user' has 'GMT' as its 'TimeZoneSidKey' field, | |
// and that the other two users run with 'America/Puerto_Rico' and | |
// 'America/Sao_Paulo'. | |
Datetime christmas2018utc; | |
System.runAs(neutral_user) { | |
// Creates a datetime instance on December 25th, at 12:00 (GMT). | |
// Using the 'runAs' method because if we don't, then the date instance will be | |
// on the same timezone as the test running user. | |
christmas2018utc = Datetime.newInstance(Date.newInstance(2018, 12, 25), Time.newInstance(12, 0, 0, 0)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from simple_salesforce import Salesforce | |
import argparse | |
parser = argparse.ArgumentParser(description='Erase logs') | |
parser.add_argument('-q', '--query', dest='query', help='ApexLog query') | |
parser.add_argument('-u', '--username', dest='username', help='Salesforce username') | |
parser.add_argument('-p', '--password', dest='password', help='Salesforce password') | |
parser.add_argument('-t', '--token', dest='token', help='Salesforce token') |
NewerOlder