Steps with explanations to set up a server using:
- virtualenv
- Django
- nginx
- uwsgi
| <!-- You are probably already familiar with the possibility of hosting static websites on Amazon S3. | |
| If not you should read this great tutorial by Chad Thompson: http://chadthompson.me/2013/05/06/static-web-hosting-with-amazon-s3/. | |
| One common problem is that while being static your website still needs a contact form. | |
| Here's a solution for this problem using Newman API (http://www.newmanapi.com). --> | |
| <html> | |
| <body> | |
| <!-- First we set the 'action' attribute of <form> to point to Newman API --> | |
| <form method="post" action="http://submit.newmanapi.com/" > | |
| <!-- Now we create our input elements as we would in any other form --> |
| <!-- You are probably already familiar with the possibility of hosting static websites on Amazon S3. | |
| If not you should read this great tutorial by Chad Thompson: http://chadthompson.me/2013/05/06/static-web-hosting-with-amazon-s3/. | |
| One common problem is that while being static your website still needs a contact form. | |
| Here's a solution for this problem using Newman API (http://www.newmanapi.com). --> | |
| <html> | |
| <body> | |
| <!-- First we set the 'action' attribute of <form> to point to Newman API --> | |
| <form method="post" action="http://submit.newmanapi.com/" > | |
| <!-- Now we create our input elements as we would in any other form --> |
| # Power mean | |
| ## Examples: | |
| ## p = 1, arithmetic mean | |
| ## p = 2, quadratic mean (RMS) | |
| pmean <- function(x, p) { | |
| library(TTR) | |
| return(tail(TTR::SMA(x^p, length(x))^(1/p), n=1)) | |
| } | |
| julia> using Quandl, TimeSeries | |
| julia> rut = quandl("YAHOO/INDEX_RUT"); | |
| julia> cot_rut = quandl("OFDP/FUTURE_COT_38"); | |
| julia> r = merge(rut, cot_rut, "Date"); | |
| julia> simple_return!(r, "Close"); |
| from flask import Flask, send_file, send_from_directory | |
| from watchdog.observers import Observer | |
| from watchdog.events import FileSystemEventHandler | |
| import os | |
| NBCONVERT_PATH = '../nbconvert/nbconvert.py' | |
| TARGET_IPYNB = 'presentation.ipynb' | |
| TARGET_HTML = 'presentation_slides.html' | |
| def nbconvert(): |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>Bootstrap, from Twitter</title> | |
| <meta name="description" content=""> | |
| <meta name="author" content=""> | |
| <!-- Le HTML5 shim, for IE6-8 support of HTML elements --> | |
| <!--[if lt IE 9]> |
| import sys | |
| import re | |
| import codecs # UniCode support | |
| from pymongo import Connection # For DB Connection | |
| from pymongo.errors import ConnectionFailure # For catching exeptions | |
| def main(): | |
| # MongoDB connection | |
| try: |
| username:sayVb7E97UXnw |