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
$("select").change(function () { | |
if ($(this).val() == 'somevalue'){ | |
// do something | |
// puedes usar $(this).text() para obtener lo que se muestra en el select, .val() devuelve es el id | |
}else{ | |
// do something else | |
} |
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
$('a.more').live('click', function(event) { | |
$.fancybox.showActivity(); | |
$.ajax({ | |
type : "POST", | |
cache : false, | |
url : "load.html", | |
data : $(this).serializeArray(), | |
success : function(data) { | |
// Aplico el selector solo al contenido de 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
$('a.more').live('click', function(event) { | |
$.fancybox.showActivity(); | |
$.ajax({ | |
type : "POST", | |
cache : false, | |
url : "load.html", | |
data : $(this).serializeArray(), | |
success : function(data) { | |
// Aplico el selector solo al contenido de 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
javascript: var i = 0; while (i<=69) { localStorage.setItem('level_star_'+i,'-1'); i++; } window.location.reload(); |
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
def add_category(request): | |
result = {'success':False} | |
n_category = request.GET.get('n_category', None) | |
if n_category is not None: | |
new_cat = Category(name=n_category) | |
new_cat.save() | |
result = {'success':True, 'value':new_cat.id} | |
json = simplejson.dumps(result) | |
return HttpResponse(json, mimetype='application/json') |
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
--- a/compressor/templatetags/compress.py | |
+++ b/compressor/templatetags/compress.py | |
@@ -32,7 +32,9 @@ class CompressorNode(template.Node): | |
exception=ImproperlyConfigured)(*args, **kwargs) | |
def debug_mode(self, context): | |
- if settings.COMPRESS_DEBUG_TOGGLE: | |
+ if settings.DEBUG: | |
+ return True | |
+ elif settings.COMPRESS_DEBUG_TOGGLE: |
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 sys, traceback | |
from django.db import models | |
import django_monitor | |
import xmlrpclib | |
class TVShow(models.Model): | |
active = models.BooleanField(default=False) | |
name = models.CharField(blank=False, max_length=20) | |
description = models.TextField(blank=False) | |
terms = models.CharField(blank=False, max_length=50) |
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
def renewTorIdentity(passAuth): | |
try: | |
s = socket.socket() | |
s.connect(('localhost', 9051)) | |
s.send('AUTHENTICATE "{0}"\r\n'.format(passAuth)) | |
resp = s.recv(1024) | |
if resp.startswith('250'): | |
s.send("signal NEWNYM\r\n") |
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
{% load crispy_forms_field %} | |
{% if field.is_hidden %} | |
{{ field }} | |
{% else %} | |
{% crispy_field field %} | |
{% endif %} |
OlderNewer