Skip to content

Instantly share code, notes, and snippets.

@brianmfear
brianmfear / GetExtraLimitsForYourUnitTest.apxc
Last active January 11, 2024 05:09
Need more CPU or heap for creating your test data? Make it Queueable.
// Asking for extra CPU time and heap for those really "heavy" orgs
@isTest class GetExtraLimitsForYourUnitTest implements Queueable {
@testSetup static void testSetup() {
Test.startTest(); // TIP: this avoids governor limits for your @isTest methods
System.enqueueJob(new GetExtraLimitsForYourUnitTest()); // We'll get async limits!
// P.S. Did you know that the end of a unit test method triggers async code,
// just as if you called Test.stopTest()?
}
public void execute(QueueableContext context) {
// I now have 60000ms to do my setup, instead of just 10000ms.
@FronkonGames
FronkonGames / TinyTween.cs
Created October 30, 2022 23:20
A Complete and Easy to use Tweens library in One File.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// _____ _ _____
// |_ _|_|___ _ _ |_ _|_ _ _ ___ ___ ___
// | | | | | | | | | | | | | -_| -_| |
// |_| |_|_|_|_ | |_| |_____|___|___|_|_|
// |___|
// A Complete and Easy to use Tweens library in One File
//
// Basic use:
@cmdr2
cmdr2 / Math3d.cs
Created November 11, 2021 07:34
Useful 3D math functions from the old Unity 3D wiki (which has been shut down). Source: the archived version from July, 2021 at https://web.archive.org/web/20210507045029/https://wiki.unity3d.com/index.php/3d_Math_functions
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System;
public class Math3d {
private static Transform tempChild = null;
private static Transform tempParent = null;