Skip to content

Instantly share code, notes, and snippets.

View keirbowden's full-sized avatar

Keir Bowden keirbowden

View GitHub Profile
@keirbowden
keirbowden / UserFreezerHelper.js
Created January 31, 2016 07:00
Lightning Component JavaScript Helper for the User Freezer Blog Post
({
doInit : function(cmp, ev) {
cmp.set('v.Message', 'Retrieving user details');
var action = cmp.get("c.GetUserDetails");
var self = this;
action.setCallback(this, function(response) {
self.actionResponseHandler(response, cmp, self, self.gotUserDetails, 'Retrieved User Details');
});
$A.enqueueAction(action);
@keirbowden
keirbowden / UserFreezer.css
Created January 31, 2016 07:01
Lightning Component Style for the User Freezer Blog Post
.THIS td {
padding: 3px 5px 2px 5px;
}
.THIS th {
padding: 3px 5px 2px 5px;
font-weight: bold;
border-bottom: 1px solid black;
}
.THIS .apply {
text-align: right;
@keirbowden
keirbowden / UserFreezerApp.app
Created January 31, 2016 07:02
Lightning Application for the User Freezer Blog Post
<aura:application >
<c:UserFreezer />
</aura:application>
<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()
{
@keirbowden
keirbowden / NotHotDog.cmp
Created July 21, 2017 11:42
Not Hotdog Lightning Component
<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">
@keirbowden
keirbowden / deploy.js
Created January 26, 2018 08:51
Simple node script to execute a deployment via SFDX and capture and output any errors that occurred
#!/usr/local/bin/node
var fs=require('fs');
var child_process=require('child_process');
var username='[email protected]';
var deployParams=['force:mdapi:deploy', '-d', 'src',
'-u', username, '--json'];
@keirbowden
keirbowden / tasks.json
Last active July 13, 2019 07:22
VSCode task file to execute
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "node",
"args": [
"deploy.js"
],
"problemMatcher": [ {
@keirbowden
keirbowden / deploy_format_output.js
Created April 16, 2018 11:49
Example Node JS script to process SFDX deployment report output and reformat.
#!/usr/local/bin/node
var fs=require('fs');
var child_process=require('child_process');
var username='[email protected]';
var deployParams=['force:mdapi:deploy', '-d', 'src',
'-u', username, '--json'];
@keirbowden
keirbowden / deploy_notify.js
Created April 16, 2018 11:54
Node JS script to generate a MacOS notification when a deployment finishes
#!/usr/local/bin/node
var fs=require('fs');
var child_process=require('child_process');
var username='[email protected]';
var deployParams=['force:mdapi:deploy', '-d', 'src',
'-u', username, '--json'];
@keirbowden
keirbowden / deploy_with_exit_codes.js
Created April 16, 2018 12:39
Node script to execute a deployment and return 0 for success or 1 for failure.
#!/usr/local/bin/node
var fs=require('fs');
var child_process=require('child_process');
var username='[email protected]';
var deployParams=['force:mdapi:deploy', '-d', 'Orchestrate/src',
'-u', username, '--json'];