Skip to content

Instantly share code, notes, and snippets.

@sudikrt
sudikrt / SObjectUtil.cls
Created May 28, 2021 19:10
Apex utility class to help deal with dynamic SObjects in Salesforce
/**
* A utility class to help when dealing with SObjects.
*
* @author Logan Moore
*/
public with sharing class SObjectUtil
{
/**
* Given two SObjects and a list of fields to compare, this method tells
* you if the list of fields are the same on both SObjects.
@sudikrt
sudikrt / AWS.cls
Created April 25, 2021 17:14 — forked from brianmfear/AWS.cls
Abstract AWS implementation in Apex Code
/*
// Example implementation as follows:
public class AWSS3_GetService extends AWS {
public override void init() {
endpoint = new Url('https://s3.amazonaws.com/');
resource = '/';
region = 'us-east-1';
service = 's3';
accessKey = 'my-key-here';
method = HttpMethod.XGET;
@sudikrt
sudikrt / EmailValidator.kt
Created May 13, 2018 08:54 — forked from ironic-name/EmailValidator.kt
Kotlin regex email validator function
fun isEmailValid(email: String): Boolean {
return Pattern.compile(
"^(([\\w-]+\\.)+[\\w-]+|([a-zA-Z]|[\\w-]{2,}))@"
+ "((([0-1]?[0-9]{1,2}|25[0-5]|2[0-4][0-9])\\.([0-1]?"
+ "[0-9]{1,2}|25[0-5]|2[0-4][0-9])\\."
+ "([0-1]?[0-9]{1,2}|25[0-5]|2[0-4][0-9])\\.([0-1]?"
+ "[0-9]{1,2}|25[0-5]|2[0-4][0-9]))|"
+ "([a-zA-Z]+[\\w-]+\\.)+[a-zA-Z]{2,4})$"
).matcher(email).matches()
}
@sudikrt
sudikrt / facebook--posts-deleter-2016-firefox-greasemonkey.js
Created November 25, 2017 03:46 — forked from vsubhash/com.vsubhash.js.facebook-posts-deleter
"Facebook Posts Deleter 2016" script is a Greasemonkey JavaScript that will automatically delete Facebook posts one by one without any user intervention. Install this script in Firefox using the Greasemonkey add-on. Then, go to your "Activity Log" and click on the "Delete Facebook Posts" that pops on the top-left.
// ==UserScript==
// @name Facebook Posts Deleter 2016
// @namespace com.vsubhash.js.facebook_posts_deleter.2016
// @description Automatically deletes posts from Activity Log of Facebook, one by one.
// @include https://www.facebook.com/*=allactivity
// @version 1
// @grant none
// ==/UserScript==
document.addEventListener("DOMContentLoaded",