Skip to content

Instantly share code, notes, and snippets.

@rponte
rponte / using-uuid-as-pk.md
Last active October 14, 2025 19:17
Não use UUID como PK nas tabelas do seu banco de dados

Pretende usar UUID como PK em vez de Int/BigInt no seu banco de dados? Pense novamente...

TL;TD

Não use UUID como PK nas tabelas do seu banco de dados.

Um pouco mais de detalhes

@karkranikhil
karkranikhil / Salesforce JS 1 certification session 1
Created July 5, 2020 03:02
Salesforce JavaScript Developer 1 certification series
// The console.log() is a function that writes a message to log on the debugging console
// Names can contain letters, digits, underscores, and dollar signs.
// No limit o the length of the variable name
// Names can begin with letter, $ and _
// Reserved words(like switch, if else) cannot be used as names
// console.log(null+'10');
// var name = "Nikhil"
// var age = 23
@SergeyLatsarus
SergeyLatsarus / download.py
Created October 24, 2018 14:39
Download attachments from Salesforce
from simple_salesforce import Salesforce
import requests
import logging
import argparse
import os
import sys
import codecs
RESULT_CSV = './attachments.csv'
@monk1337
monk1337 / nm.py
Created September 30, 2018 15:28
import pandas as pd
import re
def code_generator(Train_data,target_variable):
load_data = pd.read_csv(Train_data)
target_var = load_data.columns.get_loc(target_variable)
c = load_data.columns
if int(target_variable)!=1:
load_data[[c[1], c[target_var]]] = load_data[[c[target_var], c[1]]]
load_data.to_csv('train_data',header=False,index=False)
@cchng
cchng / salesforce.py
Last active November 25, 2018 10:21
connect to Salesforce with simple_salesforce in Python
from simple_salesforce import Salesforce
sf = Salesforce(username=...,
password=...,
security_token=...)
# SOQL
sf.query(<soql>)
# REST
# omit https://.../services/data/apiversion prefix from url
@peterlyeung
peterlyeung / sfdc.py
Created July 18, 2018 02:59
Lambda function to copy files from a SFTP server and add it to Salesforce as an attachment
import paramiko
import requests
import base64
import json
from simple_salesforce import Salesforce
#---------------------------------
# FTP portion
#---------------------------------
from utils import SalesforceUtility
username = '[email protected]'
password = 'myPassword'
token = 'mySecurityToken'
if __name__ == "__main__":
sfdc = SalesforceUtility(username, password, token)
client = sfdc.connection
@benedwards44
benedwards44 / get_data.py
Last active November 25, 2018 10:21
Get Data from Salesforce
from simple_salesforce import Salesforce
import pytz
import datetime
CLIENT_ID = '3MVG959Nd8JMmavRjCqjEGuLnGzR.CNuRMjOLwZKB_5gIxL0CvEXzU6Rqpf6pjdHu3cJXVvyYVrCwrxyLRy_i'
SANDBOX = True
USERNAME = '[email protected]'
PASSWORD = 'google12'
sf = Salesforce(
@hyrsky
hyrsky / salesforce-oauth.py
Last active November 25, 2018 10:24
Salesforce oauth example
#!/usr/bin/env python
import os
import pprint
import json
from requests_oauthlib import OAuth2Session, TokenUpdated
TOKEN_FILE = os.environ.get('TOKEN_FILE', 'token.json')
SALESFORCE_URI = os.environ.get('SALESFORCE_URI', 'https://login.salesforce.com')
@booleangate
booleangate / a-salesforce-oauth-2.0-jwt-bearer-token-flow-walk-through.md
Last active May 8, 2025 00:39
Salesforce OAuth 2.0 JWT Bearer Token Flow walk-through

Salesforce OAuth 2.0 JWT Bearer Token Flow Walk-Through

This document will walk you through how to create or configure a Salesforce application for use with JWT authentication. These configuration steps and the example code works as of Salesforce API version 42.0.

Prerequisites

Create an RSA x509 private key/certification pair