Skip to content

Instantly share code, notes, and snippets.

View MikeS-nth's full-sized avatar

Mike Sanders MikeS-nth

  • Basis Technology
View GitHub Profile
@MikeS-nth
MikeS-nth / sfdc_to_pandas.py
Created March 16, 2022 21:20
Function to import Salesforce data to tidy Pandas dataframe from a SOQL query to Salesforce via the simple-salesforce package.
# Requires simple-salesforce and pandas
# Assumes you have set environment variables for SFDC username, password, and security token
import os
import pandas as pd
from simple_salesforce import Salesforce
SFDC_USERNAME = os.environ['SFDC_USERNAME']
SFDC_PW = os.environ['SFDC_PW']
SFDC_TOKEN = os.environ['SFDC_TOKEN']
@MikeS-nth
MikeS-nth / zapier_weekday_due_date.py
Created March 16, 2022 21:13
Zapier - change date to the next weekday.
from datetime import date, timedelta
today = date.today()
due_date = date.today()
# In date.today(), Monday is 0
if today.weekday() == 4:
due_date = today + timedelta(days=3)
elif today.weekday() == 5:
@MikeS-nth
MikeS-nth / git_branch_zsh.txt
Last active April 5, 2021 19:51
Include git branch in zsh terminal prompt (MacOS)
# Inspired by / mashup of:
# https://www.themoderncoder.com/add-git-branch-information-to-your-zsh-prompt/
# and
# https://gist.github.com/reinvanoyen/05bcfe95ca9cb5041a4eafd29309ff29
# add code below to end of ~/.zshrc (in MacOs)
# Load version control information
autoload -Uz vcs_info