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
| class ControlDocument(Document): | |
| meta = { | |
| "abstract": True | |
| } | |
| #: fields | |
| availabled = BooleanField(default=False) | |
| enabled = BooleanField(default=False) | |
| created = DateTimeField(default=datetime.datetime.now()) | |
| modified = DateTimeField(default=datetime.datetime.now()) |
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
| cd /etc/httpd/conf.d/; cp ssl.conf ssl.conf.old && sed '/VirtualHost/,$ s/^/#/' ssl.conf.old > ssl.conf && service httpd restart |
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
| https://www.facebook.com/dialog/pagetab?app_id={app_id}&next={https_url} |
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/env python | |
| # -*- coding: utf-8 -*- | |
| from random import choice | |
| for a in range(20): | |
| print u'Mi primer pregunta es, qué puedo hacer si esto sale mal? %(pos)s'\ | |
| u'|Respuesta %(pos)s.1'\ | |
| u'|Respuesta %(pos)s.2'\ | |
| u'|Respuesta %(pos)s.3'\ | |
| u'|Respuesta %(pos)s.4'\ | |
| u'|Respuesta %(pos)s.5'\ |
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
| <!-- maps --> | |
| <script type="text/javascript" src="https://maps.google.com/maps/api/js?sensor=false"></script> | |
| <!-- twitter --> | |
| <script src="http://platform.twitter.com/widgets.js" type="text/javascript"></script> | |
| <!-- facebook --> | |
| <div id="fb-root"></div> | |
| <script>(function(d, s, id) { |
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
| def options(self): | |
| self.set_header('Access-Control-Allow-Origin', '*') | |
| self.set_header('Access-Control-Allow-Methods', 'POST, OPTIONS') | |
| self.set_header('Access-Control-Max-Age', 1000) | |
| self.set_header('Access-Control-Allow-Headers', '*') | |
| self.set_status(200) |
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
| function load_image_profile(url, to, w, h){ | |
| if(!url || !to) return; | |
| var img = new Image(); | |
| img.onload = function(){ | |
| var scope = $(to); | |
| var max_h = h || 176, | |
| max_w = w || 176, | |
| ratio = this.height/this.width; |
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
| class OAuth2Mixin(object): | |
| """Abstract implementation of OAuth v 2.""" | |
| def authorize_redirect(self, redirect_uri=None, client_id=None, | |
| client_secret=None, extra_params=None): | |
| """Redirects the user to obtain OAuth authorization for this service. | |
| Some providers require that you register a Callback | |
| URL with your application. You should call this method to log the | |
| user in, and then call get_authenticated_user() in the handler |
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 os, sys | |
| pkg = '/src/../path/to/main/file' | |
| root_path = os.path.dirname(__file__) | |
| sys.path.insert(0, root_path.replace(pkg, '/src')) | |
| sys.path.insert(0, root_path.replace(pkg, '/lib')) | |
| sys.path.insert(0, root_path.replace(pkg, '/libs')) | |
| sys.path.insert(0, '/Volumes/Amelie/alejandro/development/library/python') |
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
| - mongodb/bson // https://github.com/mongodb/mongo-python-driver | |
| - mongoengine // https://github.com/mongoengine/mongoengine | |
| - prettytable // http://code.google.com/p/prettytable/ |