Skip to content

Instantly share code, notes, and snippets.

Avatar

Ralph Callaway ralphcallaway

View GitHub Profile
@ralphcallaway
ralphcallaway / tutorial.md
Last active Oct 29, 2018 — forked from ChuckJonas/tutorial.md
ts-force tutorial
View tutorial.md

ts-force tutorial

This tutorial will walk will cover the basics of using ts-force. While quite a bit of functionality is not covered, I've tried to include the most common use cases.

install & configuration

Before starting, make sure you have the sfdx-cli install and a developer throw away org authenticated.

  1. git clone https://github.com/ChuckJonas/ts-scratch-paper.git ts-force-tutorial. cd into dir
  2. npm install
  3. npm install ts-force -S
View gist:8030d33a5aedec52603a
Step 2 - Deploy
[21:13:25] ~/CCC_AntScripts> ant deploy -Ddir=/Users/rwc/CCC_AntScripts/SC -Dprop=/Users/rwc/CCC_AntScripts/buildRWCskuid.properties
Buildfile: /Users/rwc/CCC_AntScripts/build.xml
deploy:
[input] Deploying to rwcSkuid@gmail.com Are you sure? (y, n)
y
[echo] Deploying /Users/rwc/CCC_AntScripts/SC from rwcSkuid@gmail.com
[sf:deploy] Request for a deploy submitted successfully.
View gist:5c3d06c3a0a44cb7108c
git config --global alias.ls 'log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate'
git config --global alias.ll 'log --pretty=format:%C(yellow)%h%Cred%d\ %Creset%s%Cblue\ [%cn] --decorate --numstat'
git config --global alias.lnc 'log --pretty=format:%h\ %s\ [%cn]'
git config --global alias.lds 'log --pretty=format:%C(yellow)%h\ %ad%Cred%d\ %Creset%s%Cblue\ [%cn] --decorate --date=short'
git config --global alias.ld 'log --pretty=format:%C(yellow)%h\ %ad%Cred%d\ %Creset%s%Cblue\ [%cn] --decorate --date=relative'
git config --global alias.le 'log --oneline --decorate'
git config --global alias.assume 'update-index --assume-unchanged'
git config --global alias.unassume 'update-index --no-assume-unchanged'
git config --global alias.assumed '!git ls-files -v | grep ^h | cut -c 3-'
git config --global alias.unassumeall '!git assumed | xargs git update-index --no-assume-unchanged'
@ralphcallaway
ralphcallaway / andyIsAwesome.r
Last active Aug 29, 2015
Submission by reference - June Salesforce Hack of the Month Submission
View andyIsAwesome.r
# /usr/bin/env copy
import http://andyinthecloud.com/2015/05/25/automating-org-setup-via-process-builder-and-metadata-api/
# no rules rulez!
View .gitignore
# Eclipse Project Files
com.salesforce.ide.core.prefs
salesforce.schema
Referenced Packages
.project
# Maven’s Mate Generated Files
apex-scripts
config
debug
View gist:af1eab92c5f83b1cf010
# Eclipse Project Files
com.salesforce.ide.core.prefs
salesforce.schema
Referenced Packages
.project
# Maven’s Mate Generated Files
apex-scripts
config
debug
@ralphcallaway
ralphcallaway / AccountHierarchy.cls
Created Oct 25, 2013
Sample code for working with account hierarchies
View AccountHierarchy.cls
/*
Developer: Ralph Callaway <ralph@callawaycloudconsulting.com>
Description:
Representation of an account hierarchy.
*/
public class AccountHierarchy {
/* Variables */
private Boolean accountsLoaded = false;
@ralphcallaway
ralphcallaway / destructiveChanges.xml
Created Feb 25, 2013
Clean a new Salesforce dev org
View destructiveChanges.xml
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<version>26.0</version>
</Package>
View DynamicDMLHelper.cls
/*
Developer: Ralph Callaway <ralph@callawaycloudconsulting.com>
Description: Helper methods for dynamic DML
*/
public class DynamicDMLHelper {
public static Object recursiveGet(sObject record, String field) {
if(field.contains('.')) {
Integer firstPeriod = field.indexOf('.');
String nextObjectName = field.subString(0, firstPeriod);
@ralphcallaway
ralphcallaway / AnotherWay.html
Created Nov 26, 2012
Alternative Implementation of Client Preferces
View AnotherWay.html
<apex:form >
<apex:pageBlock id="cp_module" rendered="{!detailKey = 'cp'}" title="Client Preferences" mode="edit">
<apex:pageblockButtons location="top">
<apex:commandButton value="Edit" rendered="{!NOT(clientPreferencesModification)}"
rerender="cp_module" status="LoadingStatusSpinner">
<apex:param assignTo="{!clientPreferencesModification}" value="true"/>
</apex:commandButton>
<apex:commandButton value="Save" rendered="{!clientPreferencesModification}"
action="{!saveClientPreferences}" status="LoadingStatusSpinner"
rerender="cp_module, im_counts"/>
You can’t perform that action at this time.