Skip to content

Instantly share code, notes, and snippets.

View dcarroll's full-sized avatar

Dave Carroll dcarroll

View GitHub Profile
@dcarroll
dcarroll / migrate.sh
Created January 8, 2019 23:37
Script to migrate Eclipse/Metadata format project to SFDX Source format project.
#!/bin/bash
if [ $# -eq 0 ]
then
echo "No arguments supplied, please supply the project directory, the source directory within the project directory and optionally 'yes' to preserve the original metadata."
exit 1
fi
if [ -z "$2" ]
then
This file has been truncated, but you can view the full file.
<?xml version="1.0" encoding="UTF-8"?>
<Profile xmlns="http://soap.sforce.com/2006/04/metadata">
<applicationVisibilities>
<application>Cloud_Tech_Support</application>
<default>false</default>
<visible>false</visible>
</applicationVisibilities>
<applicationVisibilities>
<application>LiveChat</application>
#!/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
@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
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) {
#!/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\" }"
'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++) {
@dcarroll
dcarroll / test
Created September 28, 2016 21:48
This is tes
@dcarroll
dcarroll / _authError.cshtml
Created June 23, 2015 22:46
Unexpected Errors
@if (ViewBag.ErrorMessage == "AuthorizationRequired")
{
<p>You have to sign-in to @ViewBag.OperationName. Click <a href="@ViewBag.AuthorizationUrl" title="here">here</a> to sign-in.</p>
<p>@ViewBag.ErrorMessage</p>
}
global class MyScheduler implements Schedulable {
global void execute(SchedulableContext ctx) {
// The query used by the batch job.
String query = 'SELECT Id,CreatedDate FROM Merchandise__c ' +
'WHERE Id NOT IN (SELECT Merchandise__c FROM Line_Item__c)';
CleanUpRecords c = new CleanUpRecords(query);
Database.executeBatch(c);
}