This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def connect_salesforce(username: str, password: str, security_token: str, is_test: bool) -> Salesforce: | |
'''Returns a Salesforce connection object. If test, it'll connect to Sf sandbox''' | |
domain = None | |
if is_test: | |
domain = 'test' | |
username += '.full' | |
return Salesforce(username, password, security_token, domain=domain) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# From https://powerfulpython.com/blog/nifty-python-logging-trick/ | |
import logging | |
import os | |
LOGLEVEL = os.environ.get('LOGLEVEL', 'WARNING').upper() | |
logging.basicConfig(level=LOGLEVEL) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git filter-branch --commit-filter ' | |
if [ "$GIT_AUTHOR_EMAIL" = "wrong_email@wrong_host.local" ]; | |
then | |
GIT_AUTHOR_NAME="Your Name Here"; | |
GIT_AUTHOR_EMAIL="correct_email@correct_host.com"; | |
git commit-tree "$@"; | |
else | |
git commit-tree "$@"; | |
fi' HEAD |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Delay function | |
const delay = ms => new Promise(res => setTimeout(res, ms)); | |
// Delay between clicks (seconds) | |
delayBetweenClicks = .1; | |
// Loop for all the stickers | |
stickers = document.getElementsByClassName('lCzvEVovrfFcZaKyf3ZOA'); | |
for (i=0; i<stickers.length; i++){ | |
// Clicking each emoji element for each sticker | |
stickers[i].getElementsByClassName('_2S1Fkez4JWbv9-1wbe5aeH')[0].click(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This game consist in guessing a random | |
# number in less that determinate number | |
# of attemps. | |
import random | |
import time | |
def need_a_number(user_input): | |
while not user_input.isnumeric(): |