Skip to content

Instantly share code, notes, and snippets.

View alejandrobernardis's full-sized avatar
🐻

Alejandro M. BERNARDIS alejandrobernardis

🐻
View GitHub Profile
"""
tornado_static is a module for displaying static resources in a Tornado web
application.
It can take care of merging, compressing and giving URLs ideal renamings
suitable for aggressive HTTP caching.
(c) [email protected]
"""
# mongo.conf
logpath=/var/log/mongo/mongod.log
logappend=true
fork = true
dbpath=/var/lib/mongo
auth = true
bind_ip = 127.0.0.1
rest = false
nohttpinterface = true
@alejandrobernardis
alejandrobernardis / forms.py
Created April 1, 2012 08:33 — forked from FSX/forms.py
Making use of Tornado's locale functionality in WTForms. By Ben Darnell.
import tornado.locale
from wtforms import Form, TextField, PasswordField, SubmitField, validators
# Later use e.g. FORMS['es'].LoginForm
FORMS = {}
error_msgs = (
'You must enter a username.',
@alejandrobernardis
alejandrobernardis / emails.py
Created April 4, 2012 16:49
Simple Send Email,
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2011 The Octopus Apps Inc.
# Licensed under the Apache License, Version 2.0 (the "License")
#
# Author: Alejandro M. Bernardis
# Email: alejandro.m.bernardis at gmail.com
# Created: Apr 3, 2012, 1:32:18 PM
@alejandrobernardis
alejandrobernardis / gist:2438536
Created April 21, 2012 17:18
Bootstrap, Alert, Server
(function(root){
// window
// ======
var root = this;
// underscore
// ==========
var _ = root._;
if(!_) {throw new Error('require underscore');}
from distutils.core import setup as distSetup, Extension
import os, os.path, sys
class JPypeSetup(object):
def __init__(self) :
self.extra_compile_args = []
self.macros = []
def setupFiles(self) :
Include "/var/www/vhosts/domain.tld/conf/vhost.conf"
@alejandrobernardis
alejandrobernardis / models.py
Created May 9, 2012 22:15
Models, MongoEngine, Python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2011 The Octopus Apps Inc.
# Licensed under the Apache License, Version 2.0 (the "License")
#
# Author: Alejandro M. Bernardis
# Email: alejandro.m.bernardis at gmail.com
# Created: May 8, 2012, 6:25:25 PM
@alejandrobernardis
alejandrobernardis / utils.py
Created May 16, 2012 13:49
Python Utils (GAE, Tornado, etc)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2011 The Octopus Apps Inc.
# Licensed under the Apache License, Version 2.0 (the "License")
#
# Author: Alejandro M. Bernardis
# Email: alejandro.m.bernardis at gmail.com
# Created: May 8, 2012, 2:15:08 PM
@alejandrobernardis
alejandrobernardis / forms.py
Created May 16, 2012 13:54
WTFroms for Tornado
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2011 The Octopus Apps Inc.
# Licensed under the Apache License, Version 2.0 (the "License")
#
# Author: Alejandro M. Bernardis
# Email: alejandro.m.bernardis at gmail.com
# Created: May 8, 2012, 2:32:44 PM