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
#news handler, pulls news from mongodb, renders news page | |
class NewsHandler (tornado.web.RequestHandler): | |
def get(self, currentPage): | |
news_content = dict() | |
coll = self.application.db.news | |
news = coll.find().sort("_id", DESCENDING) | |
#pagination code | |
currentPage = int(currentPage) | |
newsItemsPerPage = 2 |
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
<?php | |
/** | |
* Payoneer API integration | |
* | |
* @date 27/11/12 | |
* @name $payoneer | |
* @author Panagiotis Moustafellos | |
*/ | |
class Payoneer | |
{ |
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
#!/usr/bin/python | |
import os | |
virtenv = os.environ['APPDIR'] + '/virtenv/' | |
os.environ['PYTHON_EGG_CACHE'] = os.path.join(virtenv, 'lib/python2.6/site-packages') | |
virtualenv = os.path.join(virtenv, 'bin/activate_this.py') | |
try: | |
execfile(virtualenv, dict(__file__=virtualenv)) | |
except IOError: | |
pass |
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
<div id="main-container"> | |
<div id="main"> | |
<h1> | |
<img alt="scubabook logo" src="{{ static_url("img/logo.png") }}"> | |
</h1> | |
<div id="login-form"> | |
<form action="/auth/login/" method="post" id="login_form"> | |
<fieldset> | |
<label for="username">Username</label> | |
<input autocapitalize="off" autocorrect="off" class="text-input" id="username" name="username" tabindex="1" type="text" value=""> |
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 unittest, os, os.path, sys | |
import tornado.database | |
import tornado.options | |
from tornado.options import options | |
APP_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) | |
sys.path.append(os.path.join(APP_ROOT, '..')) | |
# import your model module | |
import your.model as model |
NewerOlder