Skip to content

Instantly share code, notes, and snippets.

View JimBTek's full-sized avatar

Jim Bartek JimBTek

View GitHub Profile
@JimBTek
JimBTek / VisualforceJavaScriptDesignPattern.html
Created September 26, 2018 17:37 — forked from douglascayers/VisualforceJavaScriptDesignPattern.html
Visualforce and JavaScript design pattern to handle page load and ajax rerendering events.
<apex:page extensions="SomeController">
<script src="{!$Resource.jquery224}"></script>
<script>$j = jQuery.noConflict();</script>
<apex:form>
<apex:outputPanel id="someSection">
... stuff here ...
@JimBTek
JimBTek / AccountSelector.cls
Created April 9, 2019 18:45 — forked from gdoenlen/AccountSelector.cls
Simple dependency injection within SFDC
/**
* Selector for the `Account` entity
*/
public class AccountSelector {
public static final AccountSelector INSTANCE = new AccountSelector();
/**
* Finds all accounts that are child accounts of
* the given opportunity's account.
@JimBTek
JimBTek / SalesForceBackup.py
Created April 22, 2019 17:36 — forked from mattkatz/SalesForceBackup.py
Simple python Script to backup a salesforce instance to csv files
from simple_salesforce import Salesforce, SalesforceMalformedRequest
from argparse import ArgumentParser
from csv import DictWriter
from datetime import date
from pathlib import Path
production_instance = 'yourinstance.salesforce.com'
parser = ArgumentParser(description="Backs up all Salesforce objects to csv files")
parser.add_argument("username", help="User to authenticate as. Should be part of an 'integration_user' profile or some profile with no ip range restriction")
@JimBTek
JimBTek / gitflowrebasing.md
Created August 2, 2019 14:14 — forked from markreid/gitflowrebasing.md
git flow with rebasing
@JimBTek
JimBTek / simple-salesforce-jwt.py
Created January 3, 2023 15:45 — forked from davidmreed/simple-salesforce-jwt.py
Using simple_salesforce with JWT authentication
import jwt
import requests
import datetime
from simple_salesforce import Salesforce
from simple_salesforce.exceptions import SalesforceAuthenticationFailed
def jwt_login(consumer_id, username, private_key, sandbox=False):
endpoint = 'https://test.salesforce.com' if sandbox is True else 'https://login.salesforce.com'
jwt_payload = jwt.encode(
{