Skip to content

Instantly share code, notes, and snippets.

View techb's full-sized avatar

K.B. Carte techb

View GitHub Profile

Steps to use Postman with Salesforce

Use Postman to send and receive API requests to Salesforce to aid in developing and testing.

Step One

  • Salesforce Org
  • Setup
  • App Manager
  • (new or select one)
  • API (Enable OAuth Settings) to get Consumer KEY and SECRET
@techb
techb / check_scroll.js
Created October 1, 2019 17:50
Check if a div or container can scroll, jQuery
jQuery(function($) {
$(".my-selector").on('scroll', function() {
if($(this).scrollTop() + $(this).innerHeight() >= $(this)[0].scrollHeight) {
// at the bottom, do stuff like hide a down arrow
$(".down-arrow").addClass("hide");
}else{
// not at bottom, show down arrow or something else
$(".down-arrow").removeClass("hide");
}
})
@techb
techb / arr_to_csv.js
Created March 14, 2019 16:58
JS Array to CSV Download
var csv_arr = [];
// add header first before pushing data
csv.push(["Bruh", "Data", "Date", "Ect"]);
for(var i = 0; i <= somedata.length; i++){
csv_arr.push(somedata[i]);
}
// found: https://gist.github.com/yangshun/01b81762e8d30f0d7f8f
document.querySelector("#muh_epic_button").addEventListener("click", function () {
@techb
techb / console-colored.py
Last active September 14, 2018 17:33
colored feedback boxes when creating cli applications.
run = '\033[1;97m[~]\033[1;m'
bad = '\033[1;31m[-]\033[1;m'
good = '\033[1;32m[+]\033[1;m'
info = '\033[1;33m[!]\033[1;m'
que = '\033[1;34m[?]\033[1;m'