Skip to content

Instantly share code, notes, and snippets.

@westc
westc / sendNewRecordsEmail.cls
Created February 16, 2024 02:25 — forked from cwest-consultch/sendNewRecordsEmail.cls
Apex - Function that sends an email of all of the new records of a given type created after a given datetime.
public static boolean sendNewRecordsEmail(String[] toAddresses, String sobjectName, DateTime createdAfter) {
String strCreatedAfter = createdAfter.formatGMT('yyyy-MM-dd\'T\'HH:mm:ss\'Z\'');
// Get the count of records after the createdAfter date/time.
String restSOQL = String.join(
new String[]{
'SELECT count(Id) record_count',
'FROM ' + sobjectName,
'WHERE CreatedDate > ' + strCreatedAfter
},
@westc
westc / Salesforce Object Describer.md
Last active December 27, 2023 01:31 — forked from cwest-consultch/Export Object Descriptions.md
Bookmarklet - Salesforce Object Describer

Salesforce Object Describer

This GitHub Gist contains the code for the YourJS Bookmarklet that can be used from within the Salesforce Developer Console to easily describe any Salesforce object.

@westc
westc / decrypt_dbvis.py
Created August 5, 2022 19:48 — forked from gerry/decrypt_dbvis.py
A quick hack to extract and decrypt credentials from DbVisualizer config files.
#!/usr/bin/env python
# decrypt_dbvis.py ~ gerry@twitter.com
# DbVisualizer uses PBEWithMD5AndDES with a static key to store passwords.
# This is a quick hack to extract and decrypt credentials from DbVisualizer config files.
# Tested against DbVisualizer Free 9.0.9 and 9.1.6
"""
[2014-03-25 02:05:30][not-the-sea workspace]$ security/p/gerry/misc/decrypt_dbvis.py
[+] DbVisualizer Password Extractor and Decryptor (@gerryeisenhaur)
[+] Additional Usage Options:
[+] security/p/gerry/misc/decrypt_dbvis.py <config filename>
@westc
westc / github-oauth2-client.php
Last active June 29, 2021 09:55
Simple PHP example of using Github's OAuth 2 API to make a login
<?php
define('OAUTH2_CLIENT_ID', '');
define('OAUTH2_CLIENT_SECRET', '');
$authorizeURL = 'https://github.com/login/oauth/authorize';
$tokenURL = 'https://github.com/login/oauth/access_token';
$apiURLBase = 'https://api.github.com/';
session_start();
@westc
westc / uri.js
Last active August 29, 2015 14:02 — forked from jlong/uri.js
Parsing a URL (jPaq Proof Test)
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
console.log(parser.protocol); // => "http:"
console.log(parser.hostname); // => "example.com"
console.log(parser.port); // => "3000"
console.log(parser.pathname); // => "/pathname/"
console.log(parser.search); // => "?search=test"
console.log(parser.hash); // => "#hash"
console.log(parser.host); // => "example.com:3000"