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
| {% if is_paginated %} | |
| <div class="col-md-offset-4"> | |
| <ul class="pagination pagination-centered"> | |
| {% if page_obj.has_previous %} | |
| <li><a href="?page=1"><<</a></li> | |
| <li><a href="?{{queries.urlencode}}&page={{ page_obj.previous_page_number }}"><</a></li> | |
| {% endif %} | |
| {% for i in paginator.page_range %} | |
| <li {% if page_obj.number == i %} class="active" {% endif %}><a href="?{{queries.urlencode}}&page={{i}}">{{i}}</a></li> |
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
| { | |
| "metadata": { | |
| "name": "", | |
| "signature": "sha256:5835de2e10cb99253cfa1841c86b02e6b9ee8b2fb21e513bbaec771e6e006c1b" | |
| }, | |
| "nbformat": 3, | |
| "nbformat_minor": 0, | |
| "worksheets": [ | |
| { | |
| "cells": [ |
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
| import json | |
| import base64 | |
| import hashlib | |
| import hmac | |
| def _prepare_headers(payload, api_key, api_secret): | |
| # payload = parameters-dictionary -> JSON encode -> base64 | |
| payload_json = json.dumps(payload) | |
| payload_encoded = base64.encodestring(payload_json) | |
| # signature = HMAC-SHA384(payload, api-secret) as hexadecimal |
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 gunicorn.app.base import Application, Config | |
| class GUnicornFlaskApplication(Application): | |
| def __init__(self, app): | |
| self.usage, self.callable, self.prog, self.app = None, None, None, app | |
| def run(self, **options): | |
| self.cfg = Config() | |
| [self.cfg.set(key, value) for key, value in options.items()] |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| { | |
| "metadata": { | |
| "name": "reading stuff in" | |
| }, | |
| "nbformat": 3, | |
| "nbformat_minor": 0, | |
| "worksheets": [ | |
| { | |
| "cells": [ | |
| { |
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
| { | |
| "metadata": { | |
| "name": "NGS" | |
| }, | |
| "nbformat": 3, | |
| "nbformat_minor": 0, | |
| "worksheets": [ | |
| { | |
| "cells": [ | |
| { |
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
| import requests | |
| import time | |
| from datetime import datetime | |
| from bs4 import BeautifulSoup | |
| URL="http://www.plosone.org/search/advanced?pageSize=12&sort=&queryField=author&queryTerm=&unformattedQuery=author%3A%22Michele+Mattioni%22&journalOpt=some&filterJournals=PLoSONE&subjectCatOpt=all&filterArticleTypeOpt=all" | |
| SENTENCE_WHICH_SHOULD_CHANGE="There were no results" | |
| article_out = False |
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
| #!/bin/bash | |
| # This hook is run after a new virtualenv is activated. | |
| # ~/.virtualenvs/postmkvirtualenv | |
| libs=( PyQt4 sip.so ) | |
| python_version=python$(python -c "import sys; print (str(sys.version_info[0])+'.'+str(sys.version_info[1]))") | |
| var=( $(which -a $python_version) ) | |
| get_python_lib_cmd="from distutils.sysconfig import get_python_lib; print (get_python_lib())" |
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
| import numpy as np | |
| import pylab as pl | |
| from numpy import sin, cos | |
| x = np.linspace(-10, 10, 500) | |
| pl.plot(x, sin(x), label="sin") | |
| pl.plot(x, cos(x), label="cos") | |
| pl.plot(x, sin(x) + cos(x), label="sin + cos") | |
| pl.plot(x, pow(sin(x), 2), label = "sin^2") |