Skip to content

Instantly share code, notes, and snippets.

View jsullivanlive's full-sized avatar

James Sullivan jsullivanlive

View GitHub Profile
@jsullivanlive
jsullivanlive / email.txt
Last active August 25, 2022 15:34
Important Information About Heroku Free Products
Subject: Important Information About Heroku Free Products
Dear Customer,
Thank you for being a Heroku user. Starting November 28, 2022, free Heroku
Dynos, free Heroku Postgres, and free Heroku Data for Redis® will no longer
be available. You can learn more about these and other important changes
from our GM, Bob Wise, on the Heroku blog.
Existing free dynos and Heroku data add-ons will be impacted, so action
@jsullivanlive
jsullivanlive / fixbranches.js
Created April 21, 2022 09:13
rebase hundreds of automated commits into linear history
const util = require('util');
const exec = util.promisify(require('child_process').exec);
const ex = async (cmd) => {
console.log({cmd});
return exec(cmd).then(console.log);
}
async function run(branch) {
try {
await ex(`git switch ${branch}`);
await ex(`git rebase master -X ours`);
@jsullivanlive
jsullivanlive / index.md
Last active April 19, 2022 17:16
Salesforce LMA App Deleting Licenses

Started getting this error email a few times a day as the owner of the LMA batch job in Salesforce:

caused by: sfLma.SubscriberUpdateException.LicenseUninstallException: Expected 1 license to delete but found 2

Class.sfLma.SubscriberUpdate.licenseUninstall: line 141, column 1

Apparently the app is deleting license records, but why?

@jsullivanlive
jsullivanlive / old stripe api versions don't return all products.md
Last active June 29, 2022 20:27
Stripe not returning newly created products

In case someone is googling for this:

I was trying to return a list of products in Stripe via their API and was not getting new products.

Stripe's api is versioned and the default version is set at your acount level. It turns out the last API upgrade I accepted was in 2011 (10 years ago) and the API was no longer returning new products. After enabling the newer api version it started returning all products.

@jsullivanlive
jsullivanlive / SalesforceID.js
Last active December 17, 2020 20:17
SalesforceID.js
/**
* helper class to manage incrementing salesforce ids
* Author: CloudAnswers
* License: AGPL3
*/
const caseSafeId = require("./caseSafeId");
const base62 = require("base-x")(
"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
);
@jsullivanlive
jsullivanlive / fix appexchange sandbox emails.txt
Created April 22, 2020 09:05
fix appexchange sandbox emails.txt
/* scheduled hourly */
List<Lead> leads = [
select Id, Email
from Lead
where IsConverted = false
and Email like '%=%@%example.com'
limit 100
];
for (Lead l : leads) {
@jsullivanlive
jsullivanlive / Salesforce Duplicate Activation Error.txt
Last active April 22, 2020 08:27
Salesforce Duplicate Activation Error
From: Salesforce Duplicate Management (noreply@salesforce.com) <noreply@salesforce.com>
Subject: We can't activate your Salesforce matching rule
Hello James Sullivan,
You tried to activate the matching rule Lead Email for identifying duplicate records. However, we can't activate the rule because it defines an unusually large number of records as possible duplicates. Specifically, take a closer look at these fields:
Email
@jsullivanlive
jsullivanlive / incremental_deploy.sh
Last active April 17, 2020 23:48
incremental deploy for salesforce metadata
#!/bin/bash
# TODO don't do master, do wherever the PR is going to?
# TODO validate that there were diffs?
# needed or diff will not be based on our current git
Echo "********** RESETTING GIT FOR CLEAN DIFF **********"
git reset --hard
ZIPFILE=diff-archive.zip
@jsullivanlive
jsullivanlive / index.js
Created April 10, 2020 19:56
how to update intercom user and clear the user_id value
// currently this does not work, we get 2xx return code but user_id is still on record
const axios = require("axios");
var basicAuth = {
auth: {
username: process.env.INTERCOM_TOKEN,
password: "",
},
};
var id = 'intercom user id';
@jsullivanlive
jsullivanlive / index.js
Created April 9, 2020 22:42
intercom search error
const axios = require("axios");
var basicAuth = {
auth: {
username: process.env.INTERCOM_TOKEN,
password: "",
},
};
(async () => {