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 dni_validator_1(dni): | |
multiplos = '32765432' | |
numbers = list('67890112345') | |
letters = list('KABCDEFGHIJ') | |
dni = list(dni) | |
control = dni.pop() | |
suma = sum(int(char) * int(mul) for mul, char in zip(multiplos, dni)) |
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
app.config(function ($httpProvider) { | |
$httpProvider.interceptors.push( | |
function ($q, $timeout) { | |
return { | |
'response': function (response) { | |
var deferred = $q.defer(); | |
if (response.headers('content-type') == 'application/json') | |
$timeout(function() {deferred.resolve(response);}, 1000); | |
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
#! /usr/bin/env python | |
# coding: utf-8 | |
import hashlib | |
from os import listdir, path, utime | |
import time | |
import pickle | |
import sys | |
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:$("> span",$("body").attr("style","")).remove();for(var m=setTimeout(function(){},0),i=0;m>i;i++)clearTimeout(i); |
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
# coding: utf8 | |
import bdb | |
import sys | |
# borrowed from: https://gist.github.com/rctay/3169104 | |
def info(type, value, tb): | |
if (hasattr(sys, 'ps1') | |
or not sys.stdin.isatty() |
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
# coding: utf-8 | |
""" | |
Cauê Thenório - cauelt(at)gmail.com | |
This snippet makes Django do not create URL languages prefix (i.e. /en/) | |
for the default language (settings.LANGUAGE_CODE). | |
It also provides a middleware that activates the language based only on the URL. | |
This middleware ignores user session data, cookie and 'Accept-Language' HTTP header. |
NewerOlder