Skip to content

Instantly share code, notes, and snippets.

@DrewCPU
DrewCPU / SV04_Z_Stepper_Alignment.gcode
Last active January 13, 2024 22:45
SV04 Z Stepper Auto Alignment
M117 Begin Z motor alignment ;Message to user
G28 ; home all axes
G90 ;Absolute positioning
G1 Z50 ;Raise gantry to 50mm
M300 ;Tone
M117 Place Z alignment guides ;Message to user
G4 P10000 ; Pause for 10 seconds
G1 Z11 ;Lower gantry to 11mm
M18 Z ;Disable Z motors
M300 ;Tone
@DrewCPU
DrewCPU / FlowApexTest.cls
Created April 25, 2022 00:40
Example Apex Test for Flow
@isTest
public static void singleTest() {
Account a = new Account(Name = 'Test Account');
insert a;
Test.startTest();
a.Do_The_Thing__c = true;
update a;
Test.stopTest();
List<FlowDefinitionView> flowList = [SELECT Id,ApiName,IsActive FROM FlowDefinitionView WHERE ApiName='Flow_That_Does_The_Thing' AND IsActive=true];
if(flowList.size() > 0) {
@DrewCPU
DrewCPU / CancellationStatus.js
Last active November 10, 2020 14:33
This is my LWC code that doesn't seem to be subscribing when I put it on a flow. It's mostly the sample code from the documentation at this point.
import { LightningElement,api } from 'lwc';
import { subscribe, unsubscribe, onError, setDebugFlag, isEmpEnabled } from 'lightning/empApi';
export default class CancellationStatus extends LightningElement {
channelName = '/event/Cancel_Result__e';
@api requestId;
showLoadingSpinner = true;
eventBody = 'Waiting for event.';
event = null;
@DrewCPU
DrewCPU / apex-07L0R000008ANksUAG.log
Created July 29, 2019 02:42
System.NoAccessException while accessing System.OrgLimits
46.0 APEX_CODE,FINEST;APEX_PROFILING,INFO;CALLOUT,INFO;DB,INFO;NBA,INFO;SYSTEM,DEBUG;VALIDATION,INFO;VISUALFORCE,INFO;WAVE,INFO;WORKFLOW,INFO
19:25:52.0 (125416)|USER_INFO|[EXTERNAL]|0050R000002I73K|test-hg6zrz52gf7v@example.com|(GMT-07:00) Pacific Daylight Time (America/Los_Angeles)|GMT-07:00
19:25:52.2 (2434882)|CODE_UNIT_STARTED|[EXTERNAL]|LimitNamesPicklist
19:25:52.2 (2807546)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:3
19:25:52.2 (2831106)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:2
19:25:52.2 (2842076)|METHOD_ENTRY|[1]|01p0R00000323XO|LimitNamesPicklist.LimitNamesPicklist()
19:25:52.2 (2848641)|STATEMENT_EXECUTE|[1]
19:25:52.2 (2853280)|STATEMENT_EXECUTE|[1]
19:25:52.2 (2857011)|METHOD_EXIT|[1]|LimitNamesPicklist
19:25:52.2 (2863304)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:4