Skip to content

Instantly share code, notes, and snippets.

View jsullivanlive's full-sized avatar

James Sullivan jsullivanlive

View GitHub Profile
@jsullivanlive
jsullivanlive / gist:216322dd2692b78a54ac07b858f82af4
Last active March 10, 2020 15:45
salesforce trailblazer nigerian-syle scammer
Mohamed Yaya (AFRICA DEVELOPMENT BANK)
Urgent Message for the Family of Sullivan
This is a personal email directed to you and I request that it be treated as such. I am Mr.Mohamed Yaya, a personal auditor to Engineer A.K.Sullivan account with the Africa Development Bank,LOME TOGO,He died some years ago in an auto accident and he left huge amount of money in the bank for no one to claim it.I want you to provide an account where this funds can be transferred to,since you have the same last name.I will like to present you to the bank here as the relative of my late client who come to claim the money (24.1 million united State dollars) deposited in the bank here in Lome Togo Africa but i have to register your information in the database as next of kin.
These are the information’s you are to send:
1.Your full names.......
2.Your date of birth..........
3.Your private telephone and fax numbers..........
@jsullivanlive
jsullivanlive / add swap in ubuntu
Created February 2, 2020 08:26
2020-02-02 add swap in ubuntu
sudo fallocate -l 4G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
@jsullivanlive
jsullivanlive / 2020-01-31 Salesforce Create Audit Fields for Task.md
Last active April 8, 2020 09:29
2020-01-31 Salesforce Create Audit Fields for Task
@jsullivanlive
jsullivanlive / gist:289ddd9f2a7f12985f5e48689682c239
Created December 11, 2019 09:05
ram copy permission sets when switching profile
/*
Set<Id> permissionSetIds = new Set<Id>();
for (PermissionSetAssignment psa : [
select PermissionSetId
from PermissionSetAssignment
where AssigneeId = '005d0000001rkdpAAA'
]) permissionSetIds.add(psa.PermissionSetId);
System.debug(JSON.serialize(permissionSetIds));
*/
@jsullivanlive
jsullivanlive / .prettierignore
Created December 18, 2018 11:02
How to make prettier ignore Salesforce's imitation JSX format html
**/lwc/**/*.html

At Salesforce, ensuring customer success through trusted system availability, performance, and reliability is our top priority. We value transparency and, as an admin of an impacted Salesforce org, we wanted to inform you of a potential issue that resulted from the October 16, 2018 service disruption of the NA33 instance.

What is the issue and impact?

On October 16, 2018, NA33 experienced a service disruption between 4:39 a.m. and 7:59 a.m. UTC. The Technology team determined that the cause of the initial issue in the Dallas data center was related to a hardware failure within the storage tier that resulted in a loss of capacity and led to the service disruption. In order to restore service as quickly as possible, the Technology team switched the NA33 instance from the Dallas data center to the Phoenix data center and normal service levels were restored. During the service disruption, there was a period of approximately 67 minutes where transactional data entered during that time was not replicated to the P

@jsullivanlive
jsullivanlive / index.js
Last active October 18, 2017 01:57
Compare custom report type fields between salesforce orgs
/**
** when you do an org-to-org migration it can be handy to know what
** fields are different between the orgs for a given report type
*/
const jsforce = require('jsforce')
var extend = require('util')._extend
async function run () {
var sourceConn = new jsforce.Connection({/*TODO*/})
@jsullivanlive
jsullivanlive / exec-anon.js
Created August 15, 2016 13:42
Run anon apex repeatedly when you have too many records to update in one transaction
var jsforce = require('jsforce');
var conn = new jsforce.Connection({
serverUrl : '',
sessionId : ''
});
var apexBody = `
update [
select id
from task
@jsullivanlive
jsullivanlive / hipchat2salesforce.js
Last active August 5, 2016 18:15
Load HipChat History to Salesforce.com
var jsforce = require('jsforce');
var fs = require('fs');
var Promise = require('bluebird');
var conn = new jsforce.Connection({});
var p = conn.login(process.env.SALESFORCE_USERNAME, process.env.SALESFORCE_PASSWORD)
.then(getLastSyncedMessage)
.then(getData)
@jsullivanlive
jsullivanlive / EmailLogic.cls
Created February 8, 2016 22:47
Salesforce Email Merge
public class EmailLogic {
public static String renderTemplate(sObject sobj, String template) {
for (String fieldName : fields(sobj.getSObjectType())) {
String key = '{!' + fieldName + '}';
while (template.containsIgnoreCase(key)) {
try {
Integer foundPosition = template.indexOfIgnoreCase(key, 0);
template = template.left(foundPosition) +
String.valueOf(sobj.get(fieldName)) +