Skip to content

Instantly share code, notes, and snippets.

@banderson5144
banderson5144 / stopBoxcar.js
Last active November 1, 2023 06:42
Stop Boxcar effect in LWC
//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() {