Skip to content

Instantly share code, notes, and snippets.

Keir Bowden keirbowden

Block or report user

Report or block keirbowden

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@keirbowden
keirbowden / SigCapFlowWithFinishController.js
Created Oct 29, 2019
Aura component controller to handle flow navigation.
View SigCapFlowWithFinishController.js
({
handleCaptured : function(component, event, helper)
{
console.log('Captured signature')
let flowAction=null;
let availableActions=component.get('v.availableActions');
console.log('Available actions = ' + availableActions);
for (let idx=0; idx<availableActions.length && null==flowAction; idx++) {
let availAction=availableActions[idx];
if ('NEXT'==availAction) {
@keirbowden
keirbowden / SigCapFlowWithFinish.cmp
Created Oct 29, 2019
Aura component to handle flow navigation.
View SigCapFlowWithFinish.cmp
<aura:component implements="lightning:availableForFlowScreens">
<aura:attribute access="global" name="startMsg" type="String" default="Click the 'Capture Signature' button to begin"
description="Message to display to the user to start the signature capture process"/>
<aura:attribute access="global" name="enterMsg" type="String" default="Sign here please"
description="Text to display above the signature capture canvas" />
<aura:attribute access="global" name="completeMsg" type="String" default="Here is the captured signature"
description="Text to display above the image of the captured signature once it has been saved to the server"/>
<aura:attribute access="global" name="recordId" type="String"
description="The id of the record to attach the signature to"/>
<aura:attribute access="global" name="saveAttachment" type="Boolean" default="true"
@keirbowden
keirbowden / animatedBar.js-meta.xml
Created Apr 6, 2019
XML Metadata for the Animated Bar Lightning Web Component
View animatedBar.js-meta.xml
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="animatedBar">
<apiVersion>45.0</apiVersion>
<isExposed>true</isExposed>
<targets>
<target>lightning__AppPage</target>
<target>lightning__RecordPage</target>
<target>lightning__HomePage</target>
</targets>
</LightningComponentBundle>
@keirbowden
keirbowden / animatedBar.js
Created Apr 6, 2019
JavaScript for the Animated Bar Lightning Web Component
View animatedBar.js
/* eslint-disable no-console */
import { LightningElement, track } from 'lwc';
export default class AnimatedBar extends LightningElement {
@track value = 0;
handleInputValueChanged(event) {
window.clearTimeout(this.delayTimeout);
const final = event.target.value;
@keirbowden
keirbowden / animatedBar.html
Created Apr 6, 2019
Animated Progress Bar Lightning Web Component Markup
View animatedBar.html
<template>
<div class="slds-m-around_small">
<div class="slds-text-heading_large slds-m-bottom_small">Progress Bar Demo</div>
<div class="slds-m-bottom_large">
<label>Enter value : <lightning-input type="number" name="seven" value="0" placeholder="Enter the amount..." onchange={handleInputValueChanged}></lightning-input></label>
</div>
<div>
<div style="width:25%" class="slds-progress-bar slds-progress-bar_circular slds-progress-bar_large"
aria-valuemin="0" aria-valuemax="100" aria-valuenow={amount} role="progressbar">
<span class="slds-progress-bar__value" style={width}>
@keirbowden
keirbowden / deploy_with_exit_codes.js
Created Apr 16, 2018
Node script to execute a deployment and return 0 for success or 1 for failure.
View deploy_with_exit_codes.js
#!/usr/local/bin/node
var fs=require('fs');
var child_process=require('child_process');
var username='keir.bowden@sfdx.deploy';
var deployParams=['force:mdapi:deploy', '-d', 'Orchestrate/src',
'-u', username, '--json'];
@keirbowden
keirbowden / deploy_notify.js
Created Apr 16, 2018
Node JS script to generate a MacOS notification when a deployment finishes
View deploy_notify.js
#!/usr/local/bin/node
var fs=require('fs');
var child_process=require('child_process');
var username='keir.bowden@sfdx.deploy';
var deployParams=['force:mdapi:deploy', '-d', 'src',
'-u', username, '--json'];
@keirbowden
keirbowden / deploy_format_output.js
Created Apr 16, 2018
Example Node JS script to process SFDX deployment report output and reformat.
View deploy_format_output.js
#!/usr/local/bin/node
var fs=require('fs');
var child_process=require('child_process');
var username='keir.bowden@sfdx.deploy';
var deployParams=['force:mdapi:deploy', '-d', 'src',
'-u', username, '--json'];
@keirbowden
keirbowden / tasks.json
Last active Jul 13, 2019
VSCode task file to execute
View tasks.json
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "node",
"args": [
"deploy.js"
],
"problemMatcher": [ {
@keirbowden
keirbowden / deploy.js
Created Jan 26, 2018
Simple node script to execute a deployment via SFDX and capture and output any errors that occurred
View deploy.js
#!/usr/local/bin/node
var fs=require('fs');
var child_process=require('child_process');
var username='keir.bowden@googlemail.com';
var deployParams=['force:mdapi:deploy', '-d', 'src',
'-u', username, '--json'];
You can’t perform that action at this time.