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
# Customize Bash PS1 prompt to show current status of active Git branch. | |
# Adapted from and inspired by http://mediadoneright.com/content/ultimate-git-ps1-bash-prompt | |
# Slightly faster prompt, as measured on my machine (TM) | |
# | |
# By @muendelezaji, Oct 2015 | |
# Skip if in zsh | |
[ "$ZSH" ] && return 0 | |
# SETUP CONSTANTS |
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
// Derived from paste at https://pastebin.com/iwqG6zvH | |
// Lightly edited to make it run | |
// Original discussion: https://t.me/GolangTZ/475 | |
// You can edit this code! | |
// Click here and start typing. | |
package main | |
import ( | |
"bufio" |
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
# 1. Create dynamic body depending on status | |
if user_status == "paid": | |
body = f"Hello paid user: {user.first_name} {user_status}" | |
else: | |
body = f"Hello not paid user: {user.first_name} {user_status}" | |
# 2. Add it to recipient email substitutions | |
to_emails.append( | |
To( | |
email=user.user_email, |
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 datetime import datetime | |
def generate_payment_ref(email, method, country): | |
""" | |
Generates a unique payment reference that will be sent to the payment provider. | |
Examples of returned references: | |
- [email protected] | |
- [email protected] | |
- [email protected] |
OlderNewer