Skip to content

Instantly share code, notes, and snippets.

@booleangate
booleangate / a-salesforce-oauth-2.0-jwt-bearer-token-flow-walk-through.md
Last active July 19, 2024 17:51
Salesforce OAuth 2.0 JWT Bearer Token Flow walk-through

Salesforce OAuth 2.0 JWT Bearer Token Flow Walk-Through

This document will walk you through how to create or configure a Salesforce application for use with JWT authentication. These configuration steps and the example code works as of Salesforce API version 42.0.

Prerequisites

Create an RSA x509 private key/certification pair

@hereswhatidid
hereswhatidid / Media.php
Last active December 11, 2019 08:50
PrestaShop Media class override to allow for forcing some inline JavaScripts to remain inline.
<?php
Class Media extends MediaCore
{
public static function deferScript($matches)
{
if (!is_array($matches))
return false;
$inline = '';
if (isset($matches[0]))
@ykurnia
ykurnia / gist:4176831
Created November 30, 2012 16:35
Salesforce trigger to generate invoice number, reset each month, based on Invoice Date {YYYY}-{MM}-{000}
trigger InvoiceTrigger2 on Invoice__c (before insert) {
if (trigger.isBefore && trigger.isInsert)
{
// ---- GENERATE INVOICE NUMBER, AUTO RUNNING NUMBER, RESET EVERY MONTH BASED ON INVOICE DATE --- //
// ---- INVOICE NUMBER FORMAT : {YYYY}-{MM}-{000} --//
// ---- ASSUME THAT INVOICE DATE CAN BE BACKDATED -- //
Integer iCharLen = 3; // character length for number
Integer iLastNo = 0; // information last running number this year
String strZero = '0';