Skip to content

Instantly share code, notes, and snippets.

@banderson5144
banderson5144 / dynamicLookup.html
Created September 19, 2025 02:25
dynamic sObject Lookup with GraphQL
<template>
<!-- https://github.com/pozil/sfdc-ui-lookup-lwc -->
<c-lookup
lwc:ref="sobjLookup"
label="sObject Lookup"
onsearch={handleLookupSearch}
onselectionchange={handleLookupSelectionChange}
></c-lookup>
</template>
@banderson5144
banderson5144 / script.cls
Last active August 25, 2025 12:56
API Access Control Cutover Script
OauthToken[] oaList = [
SELECT
LastUsedDate,AppMenuItemId,AppName,User.Profile.Name,User.ProfileId
FROM OauthToken
WHERE User.IsActive = true
/*Put additional filter based on whatever criteria your org seems sufficient*/
ORDER BY AppName
];
Set<Id> profileIds = new Set<Id>();
@banderson5144
banderson5144 / stopBoxcar.js
Last active February 1, 2025 00:01
Stop Boxcar effect in LWC (in conjunction with @zerkz)
//Original code from Stackoverflow
// https://stackoverflow.com/questions/70470728/how-can-i-execute-some-async-tasks-in-parallel-with-limit-in-generator-function/77021751#77021751
const mapParallel = async (values, fn) => {
const promises = new Set(); //Complete result set after all executions are complete
const tmpPromises = new Set(); //Container array to only allow 5 Pending promises at a time
const MAX_APEX_CALLS = 5;
for (const i in values) {
//if the size of our temp array is greater than or equal the max number of calls
//we need to wait for one of them to finish before adding another one
@banderson5144
banderson5144 / getRecordTest.js
Created June 14, 2022 02:36
LWC getRecord Usage
import { LightningElement, wire, api } from "lwc";
//1. import the methods getRecord
import { getRecord } from "lightning/uiRecordApi";
//2. Import reference to the object and the fields
import NAME_FIELD from "@salesforce/schema/Account.Name";
import RATING_FIELD from "@salesforce/schema/Account.Rating";
import INDUSTRY_FIELD from "@salesforce/schema/Account.Industry";
@banderson5144
banderson5144 / Program.cs
Created February 13, 2022 15:40
C# Simple HTTP Server
using System.Net;
using System.Text;
namespace csharp
{
class Program
{
static void Main(string[] args)
{
HttpListener server = new HttpListener();
@banderson5144
banderson5144 / github-auto-sso.user.js
Created December 10, 2020 02:47 — forked from pozil/github-auto-sso.user.js
GitHub Auto SSO script for Tampermonkey
// ==UserScript==
// @name GitHub Auto SSO
// @namespace http://pozil.github.io
// @version 1.0
// @description Adds a button that lets you automatically signs-in to all orgs that requires SSO login (instead of clicking 3x per org)
// @author pozil
// @match https://github.com/*
// ==/UserScript==
(function() {