Skip to content

Instantly share code, notes, and snippets.

Avatar

Valentijn Spruyt valentijnspruyt

View GitHub Profile
View gist:c2ec348e9e5fb7e4ad9073fee028caeb
<apex:page standardController="Case" lightningStylesheets="true" extensions="CaseTRAddendumExtension" showHeader="false" applyHtmlTag="false">
<apex:slds/>
<div>
<apex:form>
<apex:pageBlock>
<apex:pageBlockSection columns="2">
<apex:sectionHeader title="{!$Label.Create_Addendum_for_Case} {!Case.CaseNumber}" subtitle="{!$Label.Are_you_sure_you_want_to_create_an_addendum}?"
/>
View gist:0881f14da24fdd425ed07c1ecddf9259
<apex:page standardController="Case" lightningStylesheets="true" extensions="CaseTRAddendumExtension" showHeader="false" applyHtmlTag="true" applyBodyTag="false">
<head>
<apex:slds/>
</head>
<body class="slds-scope">
<apex:form>
<apex:pageBlock>
<apex:sectionHeader title="{!$Label.Create_Addendum_for_Case} {!Case.CaseNumber}" subtitle="{!$Label.Are_you_sure_you_want_to_create_an_addendum}?"
/>
@valentijnspruyt
valentijnspruyt / Exec_Anon.cls
Created Jun 19, 2020
Google coordinates tot Lambert 72
View Exec_Anon.cls
double lat = 50.3803887;
double lng = 4.9853501;
double LongRef = 0.076042943;
double bLamb = 6378388 * (1 - (1 / 297));
double aCarre = Math.pow(double.valueOf(6378388.0), double.valueOf(2.0));
double eCarre = (aCarre - Math.Pow(bLamb, double.valueOf(2.0))) / aCarre;
double KLamb = 11565915.812935;
double nLamb = 0.7716421928;
View gist:f54ca823c2b39a3737fb749ddf69409c
<html>
<head>
<apex:slds />
<script>
handleLoad = () => {
const labelArgument = "{!$ObjectType.Sales_Unit__c.labelPlural}";
const deleteConfirmed = confirm(`{!$Label.Confirm_Delete}`);
if (deleteConfirmed) {
confirmDelete();
View Ben.ino
#include <SPI.h>
#include <Ethernet.h>
EthernetClient client;
unsigned long byteCount = 0;
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
char server[] = "collabyrinth.be";
// Set the static IP address to use if the DHCP fails to assign
IPAddress ip(192, 168, 1, 39);
View gist:ac928f47392ec808bb5d0bd73bed29c5
public class MyClass {
@AuraEnabled
public Milestone__c milestone { get; set; }
@AuraEnabled
public List<Deliverable__c> deliverables { get; set; }
public MyClass(){}
}
View gist:d77a220230c21e4c9763a0dcf2257cbf
public class MyClass {
@AuraEnabled
public Milestone__c milestone { get; set; }
@AuraEnabled
public List<Deliverable__c> deliverables { get; set; }
public MyClass(){}
}
@valentijnspruyt
valentijnspruyt / computedProperty.js
Last active Mar 9, 2020
Computed property vs overhead
View computedProperty.js
@track arrayHasItems = false
@track theArray = [];
//Computed
get arrayHasItemsComputed()
{
return this.theArray.length > 0;
}
//Not computed
@valentijnspruyt
valentijnspruyt / Solution.cls
Last active Feb 24, 2020
Unit test: Internal Salesforce Error
View Solution.cls
//Throws Internal Salesforce Error
try {
insert new ContentDocumentLink();
} catch (Exception exceptionInstance){
}
//Deploys without errors
try {
ContentVersion cv = new ContentVersion();
View GoogleAuthProviderHandler
global class GoogleAuthProviderHandler implements Auth.RegistrationHandler
{
global boolean canCreateUser(Auth.UserData data)
{
// if no email is provided, we can't match with a Salesforce User
if (!String.isBlank(data.email))
{
return true;
}
return false;