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
| # Want to run your Flask tests with CSRF protections turned on, to make sure | |
| # that CSRF works properly in production as well? Here's an excellent way | |
| # to do it! | |
| # First some imports. I'm assuming you're using Flask-WTF for CSRF protection. | |
| import flask | |
| from flask.testing import FlaskClient as BaseFlaskClient | |
| from flask_wtf.csrf import generate_csrf | |
| # Flask's assumptions about an incoming request don't quite match up with |
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
| // Based on Glacier's example: http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/examples.html#Amazon_Glacier__Multi-part_Upload | |
| var fs = require('fs'); | |
| var AWS = require('aws-sdk'); | |
| AWS.config.loadFromPath('./aws-config.json'); | |
| var s3 = new AWS.S3(); | |
| // File | |
| var fileName = '5.pdf'; | |
| var filePath = './' + fileName; | |
| var fileKey = fileName; |
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
| sudo apt-get update && sudo apt-get upgrade -y; | |
| sudo apt-get build-dep -y libqt4-gui libqt4-network libqt4-webkit; | |
| sudo apt-get install -y openssl build-essential xorg git git-core libssl-dev libxrender-dev t1-xfree86-nonfree xfonts-scalable ttf-ubuntu-font-family ttf-mscorefonts-installer poppler-utils libqt4-dev qt4-dev-tools; | |
| cd ~; | |
| git clone git://gitorious.org/~antialize/qt/antializes-qt.git wkhtmltopdf-qt; | |
| git clone git://github.com/antialize/wkhtmltopdf.git wkhtmltopdf; | |
| cd wkhtmltopdf; | |
| qmake-qt4; | |
| cd ../wkhtmltopdf-qt; | |
| git checkout 4.8.4; |
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
| sudo apt-get update && sudo apt-get upgrade -y; | |
| sudo apt-get build-dep -y libqt4-gui libqt4-network libqt4-webkit; | |
| sudo apt-get install -y openssl build-essential xorg git git-core libssl-dev libxrender-dev t1-xfree86-nonfree xfonts-scalable ttf-ubuntu-font-family ttf-mscorefonts-installer poppler-utils libqt4-dev qt4-dev-tools; | |
| cd ~; | |
| git clone git://gitorious.org/~antialize/qt/antializes-qt.git wkhtmltopdf-qt; | |
| git clone git://github.com/antialize/wkhtmltopdf.git wkhtmltopdf; | |
| cd wkhtmltopdf; | |
| qmake-qt4; | |
| cd ../wkhtmltopdf-qt; | |
| git checkout 4.8.4; |