Skip to content

Instantly share code, notes, and snippets.

View ehsky's full-sized avatar

Erlend Hansen ehsky

  • Stretch Engage
  • Norway
View GitHub Profile
/* Velger fonten for nettsiden */
.wForm, .wFormTitle, .default, .wFormWebPage, .body, .wFormContainer {
font-family: 'lato';
font-weight: 300;
}
#wfTabNav {
color: #000;
}
/* sentrer neste og tilbske knapp */
.wForm .wfPagingButtons, .wForm .actions {
@ehsky
ehsky / ToastNotification_Windows10.ps1
Created April 5, 2020 13:28 — forked from altrive/ToastNotification_Windows10.ps1
Windows 10 toast notification sample
$ErrorActionPreference = "Stop"
$notificationTitle = "Notification: " + [DateTime]::Now.ToShortTimeString()
[Windows.UI.Notifications.ToastNotificationManager, Windows.UI.Notifications, ContentType = WindowsRuntime] > $null
$template = [Windows.UI.Notifications.ToastNotificationManager]::GetTemplateContent([Windows.UI.Notifications.ToastTemplateType]::ToastText01)
#Convert to .NET type for XML manipuration
$toastXml = [xml] $template.GetXml()
$toastXml.GetElementsByTagName("text").AppendChild($toastXml.CreateTextNode($notificationTitle)) > $null
@ehsky
ehsky / convertBoolean.cls
Created February 12, 2021 14:29
Convert Integer or String to Boolean in apex
// Test data
Integer intTrue = 1;
Integer intFalse = 0;
String sNumberTrue = '1';
String sNumberFalse = '0';
Boolean bTrue = true;
Boolean bFalse = false;
String capTrue = 'TRUE';
String capFalse = 'FALSE';
String smallTrue = 'true';
/**
* @description : Multi purpose class for Account Deletion.
* Can be scheduled to run itself, the batch job constructed by this class.
* @author : erlend.hansen@stretch.no | https://trailblazer.me/id/ehansen7
* @group : Consumer, Anonymization, Scheduler, Batch
* @last modified on : 10-26-2021
* @last modified by : erlend.hansen@stretch.no | https://trailblazer.me/id/ehansen7
* @example execute single batch
* Database.executeBatch( new AccountDeleteBatch(), 1);
* @example Schedule batch
@ehsky
ehsky / Create-GPID-List.ps1
Last active October 26, 2021 07:39
Creates a txt based list of GPIDs
<#
.SYNOPSIS
Creates a txt based list of GPIDs
.DESCRIPTION
Creates a txt based list of GPIDs
One GPID pr line. Can also add it with single ' before and after for salesforce support.
It provides a file saver window to save to a place of your chosing.
.OUTPUTS
@ehsky
ehsky / rounded-cornered-button-OutlookSupport.html
Created December 7, 2021 19:01
A button with rounded corner supported by outlook mail clients
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<div>
<!--[if mso]>
<v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="http://example.com" style="height:36px;v-text-anchor:middle;width:150px;" arcsize="100%" strokecolor="#EB7035" fillcolor="#EB7035">
<w:anchorlock/>
<center style="color:#ffffff;font-family:Helvetica, Arial,sans-serif;font-size:16px;">I am a button &rarr;</center>
</v:roundrect>
<![endif]-->
@ehsky
ehsky / pardot-scratchOrg-def.json
Created December 7, 2021 23:32
Scratch org file with pardot features enabled
{
"orgName": "Stretch",
"edition": "Developer",
"features": [
"EnableSetPasswordInApi",
"Pardot"
],
"hasSampleData": true,
"language": "en_US",
"settings": {
@ehsky
ehsky / CustomPreferenceCenter
Created January 26, 2022 15:35
A Custom preference center that is using 2 custom object connected to the individual object. This can be adapted to use the consent management model from salesforce instead of custom objects
<!-- CUSTOMER_NAME Profile center by Erlend Stretch Norge -->
<link href="styles" rel="stylesheet"> <!-- Import CUSTOMER_NAME stylesheet -->
<link href="https://fonts.googleapis.com/css?family=Ubuntu:300,400,500,700" rel="stylesheet" type="text/css">
<style>
body {
font-family: "Ubuntu" Fallback, sans-serif;
color: #161225;
}
.tooltip {
position: relative;
@ehsky
ehsky / CountryFlag__c
Last active November 16, 2022 12:48
Salesforce formula field to output the flag of the accounts
// Option 1: Use on plain text filds
IMAGE("https://countryflagsapi.com/png/"& ShippingCountry ,"Country flag",20,30)
/// Option 2: Custom picklist field with country iso code as values
IMAGE("https://countryflagsapi.com/png/"& text(Country_Code__c),"Country flag",20,30)
@ehsky
ehsky / GenerateMarketingCloudKeys.html
Last active December 14, 2022 10:22
Generates Symmetric, Salt and initialisation vector used in Marketing Cloud Key Management
<script runat="server">
Platform.Load("Core","1.1.1");
try{
function createPassword( len ) {
var length = (len)?(len):(10);
var string = "abcdefghijklmnopqrstuvwxyz";
//to upper
var numeric = '0123456789';
var punctuation = '!#$^&%@*';
var password = "";