Skip to content

Instantly share code, notes, and snippets.

@rsoesemann
rsoesemann / HttpMock.cls
Last active June 1, 2021 13:20
apex-http-mock
@IsTest
public class HttpMock implements HttpCalloutMock {
private static final String ANY_URL = null;
private Map<String, Map<String, Object>> responses = new Map<String, Map<String, Object>>();
// PUBLIC
@vasudevanselvaganesh
vasudevanselvaganesh / RSA.cls
Created June 28, 2019 01:02 — forked from nikitakarpenkov/RSA.cls
RSA encryption / decryption in salesforce apex
public class RSA {
private Key key;
// Hex digits
private static final String DIGITS = '0123456789abcdef';
private static final Decimal HEX_BASE = 16;
public abstract class Key {
private String modulus;
public Key(String modulus) {
@swapnilshrikhande
swapnilshrikhande / README.md
Last active May 19, 2022 04:29
System Development Analysis Checklist

Per Requirement Analysis Checklist

  1. Possible way to approach the requirements to frame right set of questions ? - [ ] Which is the core domain problem system will be resolving or we will be automating ?
    • Business Domain - Eg. Automating Sales Process
    • Technical Domain - Eg. CTI Integration, Salesforce Sales Cloud Implementation
    • What is the need of the system ?
    • Who are the end users of the system ?
    • Who are the super/admin users of the system ?
@sfcure
sfcure / LightningRecordEditForm.xml
Last active April 18, 2021 07:12
This is a working example of rendering Lightning:RecordEditForm dynamically as per object's page layout
<aura:component implements="flexipage:availableForAllPageTypes" access="global" controller="LightningRecordEditFormController">
<aura:attribute name="disabled" type="Boolean" default="false" />
<aura:attribute name="layoutSections" type="List" />
<aura:attribute name="saved" type="Boolean" default="false" />
<aura:attribute name="showSpinner" type="Boolean" default="true" />
<aura:attribute name="fieldName" type="String" default="StageName" />
<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
<lightning:card title="">
@swapnilshrikhande
swapnilshrikhande / parseJSExpression.js
Created July 11, 2018 07:41
Parse Javascript Boolean Expression Inside String
var exp1 = "(true && true || false) && (true || (false && true))";
var exp2 = "((true && true) || false && !true)";
var exp3 = "(true && !false) && true && !false";
var exp4 = "(a && b) && c && d";
console.log(exp1 + ' = ' + parseBoolStr(exp1));
console.log(exp2 + ' = ' + parseBoolStr(exp2));
console.log(exp3 + ' = ' + parseBoolStr(exp3));
console.log(exp4 + ' = ' + parseBoolStr(exp4));
@andidev
andidev / WebDriverExtensionsExampleTest.java
Last active September 3, 2017 11:32
Example of a WebDriver Extensions Test
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.WebElement;
import com.github.webdriverextensions.junitrunner.WebDriverRunner;
import com.github.webdriverextensions.junitrunner.annotations.*;
import static com.github.webdriverextensions.Bot.*;
import static java.util.concurrent.TimeUnit.SECONDS;
@swapnilshrikhande
swapnilshrikhande / makePanelSticky
Last active August 29, 2015 14:04
Make a panel sticky using jquery
/*Use case
Define styles for before floating and when floating as below.
.panel-static {
position: relative;
left: 0px;
z-index: 200;
width: 260px;
height: 500px;
float: left;
@staltz
staltz / introrx.md
Last active May 3, 2024 13:00
The introduction to Reactive Programming you've been missing
@jtan189
jtan189 / JavaPasswordSecurity.java
Created September 29, 2012 15:10
Java PBKDF2 Password Hashing Code
import java.security.SecureRandom;
import javax.crypto.spec.PBEKeySpec;
import javax.crypto.SecretKeyFactory;
import java.math.BigInteger;
import java.security.NoSuchAlgorithmException;
import java.security.spec.InvalidKeySpecException;
/*
* PBKDF2 salted password hashing.
* Author: havoc AT defuse.ca
@keeguon
keeguon / countries.json
Created April 5, 2012 11:11
A list of countries in JSON
[
{name: 'Afghanistan', code: 'AF'},
{name: 'Åland Islands', code: 'AX'},
{name: 'Albania', code: 'AL'},
{name: 'Algeria', code: 'DZ'},
{name: 'American Samoa', code: 'AS'},
{name: 'AndorrA', code: 'AD'},
{name: 'Angola', code: 'AO'},
{name: 'Anguilla', code: 'AI'},
{name: 'Antarctica', code: 'AQ'},