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. |
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
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
#! /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
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
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
# coding: utf8 | |
import re | |
from functools import reduce | |
def merge_dicts(*dicts): | |
# http://stackoverflow.com/questions/7204805/dictionaries-of-dictionaries-merge | |
if not reduce(lambda x, y: isinstance(y, dict) and x, dicts, True): | |
raise TypeError("Object in *dicts not of type 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
class DynamicLookupMixin(object): | |
''' | |
A mixin to add support to related attributes like | |
'book_author' in django ModelAdmin list_display field | |
creating callables on the fly | |
''' | |
def __getattr__(self, attr): | |
if ('__' in attr | |
and not attr.startswith('_') |
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
# Remove linha com codigo malicioso de arquivos php hackeados (sed para linux) | |
find . -name "*.php" -exec sed -i '1s/^<?php if(!isset(\$GLOBALS\["\\x61\\156\\x75\\156\\x61.*-1; ?>//' {} \; | |
# Remove linha com codigo malicioso de arquivos php hackeados (sed para mac) | |
find . -name "*.php" -exec sed -i '1s/^<\?php if(!isset(\$GLOBALS\["\\\x61\\\156\\\x75\\\156\\\x61.*-1; \?>//' {} \; |
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
/* | |
Simple WhatsApp Web Spam Bot Originally written by Pablode. Modified by Gal Bracha. | |
Use with love <3. Do not act reckless. | |
==================================================================================== | |
DISCLAIMER: I do not take any responsibility for any damage caused with this script. | |
WhatsApp might be able identify script users if this becomes a problem. Do only use | |
this if you are aware of the consquences. | |
==================================================================================== | |
Usage: Copy all of this script (Ctrl+A, Ctrl+C). Add a new Bookmark. In the URL section, | |
write "javascript:" and paste (Ctrl+V) this script. Visit WhatsApp Web, select your |
OlderNewer