This file contains 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 django.contrib.contenttypes.fields import GenericForeignKey | |
from django.contrib.contenttypes.models import ContentType | |
class Log_Entry_General(models.Model): | |
mensaje = models.CharField() | |
content_type = models.ForeignKey(ContentType) | |
object_id = models.PositiveIntegerField() | |
object = Generic.ForeignKey('content_type', 'object_id') |
This file contains 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
#Encontrado en Google https://groups.google.com/forum/#!topic/django-users/RM7ZZ9naNQA | |
def obtener_request(): | |
try: | |
user = None | |
outer_frames = inspect.getouterframes(inspect.currentframe()) | |
for tpl in outer_frames: | |
arginfo = inspect.getargvalues(tpl[0]) | |
if(type(arginfo[3]) is dict): | |
arg_dict = arginfo[3].copy() | |
for k in arg_dict: |
This file contains 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 django.db.models.signals import pre_save, pre_delete | |
from django.contrib.admin.models import LogEntry, DELETION, ADDITION, CHANGE | |
from django.utils.encoding import force_text | |
##Django admin | |
def get_content_type_for_model(obj): | |
return ContentType.objects.get_for_model(obj) | |
import inspect | |
from django.core.handlers.wsgi import WSGIRequest |
This file contains 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 django.db.models.signals import pre_delete, post_save | |
from django.contrib.admin.models import LogEntry, DELETION, ADDITION, CHANGE | |
from django.utils.encoding import force_text | |
##Django admin | |
def get_content_type_for_model(obj): | |
return ContentType.objects.get_for_model(obj) | |
import inspect | |
from django.core.handlers.wsgi import WSGIRequest |
This file contains 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 uuid | |
import requests | |
from django.core.files.base import ContentFile | |
from django.db import models | |
from django.db.models.fields.files import ImageFileDescriptor, ImageFieldFile | |
class UrlImageFileDescriptor(ImageFileDescriptor): | |
def __init__(self, field): |
This file contains 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 app = angular.module('ExtensionAcademica',['ngSanitize']); | |
app.controller("TabCtrl", ["$scope", "$http","$sce",function($scope, $http,$sce){ | |
$http.get("http://192.168.1.67:8000/game").success(function(data, status, headers, config){ | |
$scope.currentTab = $sce.trustAsHtml(data); | |
}); | |
This file contains 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
<!DOCTYPE html> | |
<!--[if lt IE 7 ]><html class="ie ie6" lang="en"> <![endif]--> | |
<!--[if IE 7 ]><html class="ie ie7" lang="en"> <![endif]--> | |
<!--[if IE 8 ]><html class="ie ie8" lang="en"> <![endif]--> | |
<!--[if (gte IE 9)|!(IE)]><!--><html lang="en"> <!--<![endif]--> | |
<head> | |
<!-- Necesidades básicas de la página | |
================================================== --> | |
<meta charset="utf-8"> |
This file contains 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 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 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); |
OlderNewer