Skip to content

Instantly share code, notes, and snippets.

{"lastUpload":"2020-06-29T23:50:04.400Z","extensionVersion":"v3.4.3"}
@jerome-d-russ
jerome-d-russ / EmailAttachment.cls
Created September 15, 2018 19:40
Apex Email Attachment
List<Account > acclist = [Select id,name , CreatedDate , lastModifiedDate from Account limit 10];
string header = 'Record Id, Name , Created Date, Modified Date \n';
string finalstr = header ;
for(Account a: acclist)
{
string recordString = '"'+a.id+'","'+a.Name+'","'+a.CreatedDate+'","'+a.LastModifiedDate +'"\n';
finalstr = finalstr +recordString;
}
Messaging.EmailFileAttachment csvAttc = new Messaging.EmailFileAttachment();
blob csvBlob = Blob.valueOf(finalstr);
@jerome-d-russ
jerome-d-russ / CastListToMap
Created September 14, 2018 21:03
Cast List<SObject> to Map<Id, SObject>
Map<Id, sObject> myAwesomeMap = new Map<Id,sObject>(List of sObjects or SOQL Query);
@jerome-d-russ
jerome-d-russ / AutoSave.cs
Created August 9, 2018 16:46 — forked from nirleka/AutoSave.cs
Unity 5 AutoSave on Run & on 1-10 minutes interval
using UnityEngine;
using UnityEditor;
using System;
using UnityEditor.SceneManagement;
using UnityEngine.SceneManagement;
namespace NirSoft.UtilityEditor
{
/// <summary>
/// Autosave scene on run.
@jerome-d-russ
jerome-d-russ / FolderSize.ps1
Created August 22, 2017 20:05
A Powershell script for listing the file size of Steam games (and other folders)
$startFolder = "C:\Program Files (x86)\Steam\steamapps\common"
$colItems = (Get-ChildItem $startFolder | Measure-Object -property length -sum)
#"$startFolder -- " + "{0:N2}" -f ($colItems.sum / 1MB) + " MB"
"Folder | Size (MB)"
$colItems = (Get-ChildItem $startFolder | Where-Object {$_.PSIsContainer -eq $True} | Sort-Object)
foreach ($i in $colItems)
{
$objFSO = New-Object -com Scripting.FileSystemObject
@jerome-d-russ
jerome-d-russ / SocialHandles.js
Created March 9, 2017 19:06
javascript, to show socia media handles
//Originally from http://codepen.io/NerdOrDie/pen/vNEvee?editors=0010
var settings = {
// Simply change the name in quotes with your name
social: {
// Twitch Name
twitchUsername: "ChangeThis",

Query EventLogFile

services/data/v37.0/query?q=SELECT+Id+,+EventType+,+LogDate+,+LogFileLength+,+LogFile+FROM+EventLogFile+WHERE+EventType+=+'ReportExport'
@jerome-d-russ
jerome-d-russ / DeleteJenkinsBuildHistory.groovy
Last active January 12, 2017 22:22
Use this script via Manage Jenkins -> Script Console to delete the entire build history for a project.
// change this variable to match the name of the job whose builds you want to delete
def jobName = "The Name of the Job Here"
def job = Jenkins.instance.getItem(jobName)
job.getBuilds().each { it.delete() }
// uncomment these lines to reset the build number to 1:
//job.nextBuildNumber = 1
//job.save()
/* Get list of asynchronous jobs in Salesforce */
select id, jobtype, methodname, status, apexclass.name from asyncapexjob