Skip to content

Instantly share code, notes, and snippets.

View dcarroll's full-sized avatar

Dave Carroll dcarroll

View GitHub Profile
#!/bin/sh
# NOTE: The pilot version included the Heroku CLI.
# Running the script will blow away ALL Heroku folders.
# You may need to reinstall the Heroku Toolbelt.
# NOTE: As with any script you download on the internet,
# please make sure you understand what each command is
# going to do before running it.
rm -rf /usr/local/heroku
'use strict';
const path = require('path');
const cmds = require('./dist/index.js');
let cmd;
let flags;
const options = JSON.parse(process.argv[2].trim());
for (let i=0, len=cmds.commands.length; i<len; i++) {
#!/bin/bash
while [ $# -gt 0 ]
do
echo $1
command=$command" "$1
shift
done
echo $command
node-debug.js <path to your toolbelt source code root>/debug.js "{ \"cmd\":\"$command\" }"
let fund = require("./data/dreaminvest-data-fund.json");
let plan = require("./data/dreaminvest-data-plan.json");
let records = fund.records;
let i,j,temparray = [],chunk = 200;
let fname = `data/dreaminvest-data-fund${i}d.json`;
let writeFile = function(name, contents) {
var fs = require('fs');
fs.writeFile(name, contents, function(err) {
@dcarroll
dcarroll / NotDevHub.sh
Created July 28, 2017 17:02
Simple script to check if the org you are using is a Dev Hub. Run by passing a username or alias to the script.
#!/bin/bash
# specify your username or alias
usernameOrAlias=$1
hub=$(sfdx force:data:soql:query -q "SELECT DurableId, SettingValue FROM OrganizationSettingsDetail WHERE SettingName = 'ScratchOrgManagementPref'" -t -u ${usernameOrAlias} --json)
# parse response
size="$(echo ${hub} | jq -r .result.size)"
@dcarroll
dcarroll / demo-commands.sh
Created August 3, 2017 17:55
Commands to demo SFDX
#!/bin/bash
function prompt {
echo ""
echo $1
}
prompt "Create project workspace..."
sfdx force:project:create -n Demo
cd Demo
@dcarroll
dcarroll / reset-demo.sh
Created August 3, 2017 17:56
Commands to reset SFDX Demo
#!/bin/bash
sfdx force:org:delete -u Demo -p
rm -rf Demo
@dcarroll
dcarroll / demo-script.sh
Last active April 5, 2019 23:07
Handy script that executes the DX Demo scripts steps one at a time. Just keep hitting return. You can cancel the script by enter `q` then `return`. The scripts assumes that you have authenticated to a hub org already. Everything about this script happens relative to where you are running it from.
#!/bin/bash
txtred='\e[0;31m' # Red
bldgrn='\e[1;32m' # Green
txtrst='\e[0m' # Text Reset
#trap "exit 1" TERM
#export TOP_PID=$$
prompt() {
@dcarroll
dcarroll / .bash_profile
Last active May 15, 2021 18:06
This is the bash profile that I use. You will see some things commented out and some experiments. Feel free to remove those, build on them, whatever you want to do. Make sure you look as the path exporting section as you system may have different paths.
# dx customizations
alias status='(sfdx force:org:list &
sfdx force:alias:list &
sfdx force:config:list; wait)'
alias orglist='sfdx force:org:list'
alias orglistc='sfdx force:org:list --clean -p'
alias push='sfdx force:source:push'
alias pull='sfdx force:source:pull'
@dcarroll
dcarroll / uninstall-sfdx-ga.sh
Created November 16, 2017 22:01
Uninstall script for Salesforce CLI installed via the Mac OSx installer DMG.
#!/bin/sh
# NOTE: As with any script you download on the internet,
# please make sure you understand what each command is
# going to do before running it.
rm -rf /usr/local/sfdx
rm -rf /usr/local/lib/sfdx
rm -rf /usr/local/bin/sfdx
rm -rf ~/.local/share/sfdx ~/.config/sfdx ~/.cache/sfdx