Skip to content

Instantly share code, notes, and snippets.

Keir Bowden keirbowden

View GitHub Profile
@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 Jan 26, 2018
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'];
@keirbowden
keirbowden / NotHotDog.cmp
Created Jul 21, 2017
Not Hotdog Lightning Component
View NotHotDog.cmp
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,force:hasRecordId" access="global" controller="EinsteinVision_Admin">
<aura:attribute name="initialised" type="boolean" default="false" />
<aura:attribute name="files" type="Object[]"/>
<aura:attribute name="spinnerWaiting" type="Boolean" default="false"/>
<aura:attribute name="image" type="String" />
<aura:attribute name="imagedata" type="String" />
<aura:attribute name="result" type="String" default="Need a picture"/>
<aura:attribute name="showResult" type="Boolean" default="false" />
<div class="slds-page-header">
View VFPageMetrics.page
<apex:page >
<script type="text/javascript">
var __sfdcSessionId = '{!GETSESSIONID()}';
</script>
<script src="../../soap/ajax/40.0/connection.js"
type="text/javascript"></script>
<script type="text/javascript">
function getMetrics()
{
You can’t perform that action at this time.