Skip to content

Instantly share code, notes, and snippets.

View liratanak's full-sized avatar

Liratanak ANN liratanak

View GitHub Profile
@liratanak
liratanak / Salesforce-with-Nodejs-Asymmetric-Encryption.md
Last active September 19, 2023 16:11
Asymmetric Encryption - Salesforce & Nodejs

Node.js Asymmetric Cryptography to encrypt data in Salesforce Apex and decrypt it in Node.js:

  1. Generate a public and private key pair in Node.js using the built-in crypto module.
  2. Export the public key from Node.js and import it into Salesforce.
  3. Use the imported public key to encrypt the data in Salesforce Apex.
  4. Send the encrypted data to Node.js.
  5. Use the private key in Node.js to decrypt the encrypted data.

Here's an example code snippet that demonstrates how to generate a key pair in Node.js, export the public key, and import it into Salesforce:

@liratanak
liratanak / selenium-js-voterlist-example.js
Created April 25, 2023 16:43
selenium-js-voterlist-example.js
const {Builder, By, Key, until} = require('selenium-webdriver');
// Create a new driver instance
let driver = new Builder().forBrowser('chrome').build();
let listOfVoterIds = [
"1234567890123",
"1234567890124",
"1234567890125"
];
@liratanak
liratanak / auto_refresh_sfdc_metadata.sh
Last active November 10, 2016 04:15
Auto-refresh Salesforce metadata and versioning to git
#!/bin/bash
# Constants
INTEGER_RE="^[0-9]+$"
DEFAULT_SRC="src"
MIN_INTERVAL=1
# Variables re-initialize if other env have
AUTH_FILE="auth"
FORCE_COMMAND="force"
@liratanak
liratanak / README.md
Created August 1, 2016 01:52
Versioning Force.com Metadata with Git

Versioning Force.com Metadata with Git

  1. Install git https://git-scm.com/downloads
  2. On project root path, then initialize git init
  3. Refresh your metadata as usual
  4. Submit the change git add -A && git commit -am "add your comments here"
  5. Keep repeating (3) and (4)

Above steps, help you to versioning your org metadata on your local machine. So you don't need any server, you won't conflict with others.

@liratanak
liratanak / date-khmer.js
Created May 28, 2016 08:52
Convert to Khmer date format
Date.prototype.getAmPm = function () {
if( this.getHours() >= 12 ) { return 1 }; // pm
return 0; // am
}
var locale = {
en: {
month: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September ', 'October', 'November', 'December'],
ampm: [ 'am', 'pm' ]
},
@liratanak
liratanak / .gitignore
Last active May 25, 2016 08:45
angular-multi-select example
node_modules/
bower_components/
@liratanak
liratanak / README.md
Created May 20, 2016 04:26
Install MavensMate on Sublime Text

Install MavensMate on Sublime Text

1 - Install Package Control

2 - Install MavensMate

  • via Package Control, "Package Control: Install Package"
  • Update work space path, MavensMate => Settings => Users, mm_workspace
  • Install MavensMate API, MavensMate => MavensMate API (mm) => Install MavensMate API (mm) version... => select the lastest one