Skip to content

Instantly share code, notes, and snippets.

View jsullivanlive's full-sized avatar

James Sullivan jsullivanlive

View GitHub Profile
@jsullivanlive
jsullivanlive / 1. result
Last active December 14, 2015 21:49
Was going to deploy a rest web service on Heroku and was curious if there was a big difference between handling very simple requests between the standard ways of deploying to Heroku for Flask/wsgi/Go: Golang Requests per second: 6446.75 [#/sec] (mean) Flask Requests per second: 1029.64 [#/sec] (mean) gunicorn+wsgi Requests per second: 2164.54 [#…
Golang Requests per second: 6446.75 [#/sec] (mean)
Flask Requests per second: 1029.64 [#/sec] (mean)
gunicorn+wsgi Requests per second: 2164.54 [#/sec] (mean)
/*
* Author: Kevin O'Hara
* Date: 02/10/2012
*
* Description: The Async class aims to circumvent a limitation of asynchronous (@future)
* methods in Salesforce. The current @future implementation will only allow for primitives
* or collections of primitives to be passed into an @future method. The Async class uses
* native JSON serialization/deserialization to allow for passing an SObject, or List<SObject>
* into an asynchronous method for DML operations. A helper method is also included for making
* the serialization processes simpler.
<apex:page showHeader="false" sidebar="false" expires="0" cache="false" docType="html" controller="TargetX_Base.TX_CommunitiesBase" extensions="AppStartController">
<apex:composition template="{!defaultTemplate}">
<!-- use head for extra css or important js before dom load -->
<apex:define name="head"/>
<!-- set subheading tag to disable the boilerplate heading -->
<apex:define name="subheader"/>
<apex:define name="content">
@jsullivanlive
jsullivanlive / gist:88668ea7c98aa11b7e04
Last active August 29, 2015 14:23
Update user story ranks from raw data using data in a json field
Map<String, Id> rank = new Map<String, Id>();
Map<Id, User_Story__c> stories = new Map<Id, User_Story__c>([
select Id, Customer_Story_ID__c, Customer_Story_Raw_Data__c
from User_Story__c
where Project__r.Name = 'projectname'
]);
for (User_Story__c us : stories.values()) {
if (String.isBlank(us.Customer_Story_Raw_Data__c)) continue;
Map<String, Object> data = (Map<String, Object>)JSON.deserializeUntyped(us.Customer_Story_Raw_Data__c);
// rally DragAndDropRank is not unique, so combine with id
@jsullivanlive
jsullivanlive / anon.apex
Created October 12, 2015 18:37
Update date field based on lead history using anonymous apex
Lead[] leads = [
select Id,
(select Id, Field, OldValue, NewValue, CreatedDate from Histories order by CreatedDate asc)
from Lead
where Status='Closed'
and Closed_Date__c = null
order by LastModifiedDate asc
limit 1000
];
Lead[] toUpdate = new Lead[]{};
@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)) +
@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 / 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 / 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*/})

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