Skip to content

Instantly share code, notes, and snippets.

@rtconner
rtconner / Delete All Batch Jobs
Last active July 18, 2016 18:48
Delete All Batch Jobs
global class deletebatch implements Database.Batchable<sObject> {
global Database.QueryLocator start(Database.BatchableContext BC) {
string txt = 'Bulk Convert Lead Batch';
String query = 'SELECT Id, CronJobDetail.Id, CronJobDetail.Name, CronJobDetail.JobType FROM CronTrigger WHERE CronJobDetail.Name LIKE \'Bulk Convert Lead Batch%\' LIMIT 150';
return Database.getQueryLocator(query);
}
global void execute(Database.BatchableContext BC, List<crontrigger> scope) {
for(crontrigger a : scope)
{
@rtconner
rtconner / RestRequestMultipart.cls
Last active May 2, 2016 16:26
Salesoforce Apex parse RestRequest into multipart
public with sharing class RestRequestMultipart
{
public List<RestRequest> requests;
public Map<String, String> headers;
public String httpMethod;
public Map<String, String> params;
public String remoteAddress;
public String requestURI;
public String resourcePath;
@rtconner
rtconner / SftpServiceProvider.php
Last active June 27, 2024 09:07
Provider so you can add a 'sftp' connection in Laravel 5 filesystems.php - "Call to undefined method League\Flysystem\Filesystem::createSftpDriver"
<?php
namespace App\Providers;
use League\Flysystem\Sftp\SftpAdapter;
use Storage;
use League\Flysystem\Filesystem;
use Illuminate\Support\ServiceProvider;
/**