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 sublime | |
| import sublime_plugin | |
| import time | |
| class ExampleCommand(sublime_plugin.TextCommand): | |
| def run(self, edit): | |
| the_sels = self.view.sel() | |
| the_sels_begin = the_sels[0].begin() | |
| the_sels_end = the_sels[0].end() |
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 sublime | |
| import sublime_plugin | |
| import urllib2 | |
| class ExampleCommand(sublime_plugin.TextCommand): | |
| def run(self, edit): | |
| the_sels = self.view.sel() | |
| the_sels_begin = the_sels[0].begin() | |
| the_sels_end = the_sels[0].end() |
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
| var http = require('http'), | |
| fs = require('fs'), | |
| url = require('url'), | |
| qs = require('querystring'), | |
| io = require('socket.io'); | |
| var server = http.createServer(function(req, res){ | |
| res.setHeader('Content-Type','application/json'); | |
| if (req.headers['user-agent'] == 'RTC-UA'){ | |
| var GET = qs.parse(url.parse(req.url).query); |
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 checar_tiempo (startdate, tiempo_de_creacion) { | |
| if(startdate.getSeconds() > tiempo_de_creacion.getSeconds() && startdate.getMinutes() === tiempo_de_creacion.getMinutes() && startdate.getDay() === tiempo_de_creacion.getDay() && startdate.getMonth() === tiempo_de_creacion.getMonth() && startdate.getFullYear() === tiempo_de_creacion.getFullYear() && startdate.getHours() === tiempo_de_creacion.getHours()){ | |
| tiempo = "A few "; | |
| quees = "seconds"; | |
| }else if(startdate.getMinutes() > tiempo_de_creacion.getMinutes() && startdate.getDay() === tiempo_de_creacion.getDay() && startdate.getMonth() === tiempo_de_creacion.getMonth() && startdate.getFullYear() === tiempo_de_creacion.getFullYear() && startdate.getHours() === tiempo_de_creacion.getHours()){ | |
| tiempo = startdate.getMinutes() - tiempo_de_creacion.getMinutes() ; | |
| quees = " minutes"; |
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 base64 | |
| import urllib2 | |
| import json | |
| import httplib | |
| class CouchDatabase(object): | |
| def __init__(self,host="http://localhost", port=5984): |
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
| http://stackoverflow.com/questions/4475251/django-through-model-iteration | |
| http://www.djangobook.com/en/2.0/chapter10.html |
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 database import CouchDatabase | |
| import base64 | |
| import urllib2 | |
| import json | |
| import httplib | |
| class CouchDocument(CouchDatabase): | |
| def __init__(self, host="http://localhost", port=5984, database="pruebas"): |
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 base64 | |
| import urllib2 | |
| import json | |
| import httplib | |
| class CouchDatabase(object): | |
| def __init__(self, host="localhost", port=5984): |
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://gist.github.com/anonymous/5580444 |
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 pdf(request): | |
| response = HttpResponse(content_type="application/pdf") | |
| response['Content-Disposition'] = 'attachment; filename="UTEL_Tramites.pdf"' | |
| file_ = GenerarPDF(response=response, user=User.objects.get(id=1)) | |
| to_admin = '[email protected]' | |
| html_content = "Informacion recibida de <br><br><br>***Mensaje****<br><br>" | |
| msg = EmailMessage('Correo de Contacto', html_content, '[email protected]', [to_admin]) | |
| msg.attach('UTEL_Tramites.pdf', response.content, 'application/pdf') | |
| msg.send() | |
| return response |
OlderNewer