This file contains 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
''' quick example showing how to attach a pdf to multipart messages | |
and then send them from SES via boto | |
''' | |
from email.mime.text import MIMEText | |
from email.mime.application import MIMEApplication | |
from email.mime.multipart import MIMEMultipart | |
import boto |
This file contains 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 django.shortcuts import redirect | |
from social_auth.middleware import SocialAuthExceptionMiddleware | |
from social_auth.exceptions import AuthAlreadyAssociated | |
class CustomSocialAuthExceptionMiddleware(SocialAuthExceptionMiddleware): | |
def get_redirect_uri(self, request, exception): | |
if isinstance(exception, AuthAlreadyAssociated): | |
# Redirect this error to a custom page where the situation is |
This file contains 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
# The install script | |
# Adapted from https://gist.github.com/579814 | |
echo '# Added by install script for node.js and npm in 30s' >> ~/.bashrc | |
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
echo 'export NODE_PATH=$HOME/local/lib/node_modules' >> ~/.bashrc | |
. ~/.bashrc | |
mkdir -p ~/local | |
mkdir -p ~/Downloads/node-latest-install |