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
jQuery.expr[':'].contains = function(a, i, m) { | |
var rExps=[ | |
{re: /[\xC0-\xC6]/g, ch: "A"}, | |
{re: /[\xE0-\xE6]/g, ch: "a"}, | |
{re: /[\xC8-\xCB]/g, ch: "E"}, | |
{re: /[\xE8-\xEB]/g, ch: "e"}, | |
{re: /[\xCC-\xCF]/g, ch: "I"}, | |
{re: /[\xEC-\xEF]/g, ch: "i"}, | |
{re: /[\xD2-\xD6]/g, ch: "O"}, | |
{re: /[\xF2-\xF6]/g, ch: "o"}, |
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 requests, re | |
problem_name = 'even-or-odd' | |
problem_url = 'https://www.codewars.com/kata/' + problem_name | |
users = [ 'fabiopedrosa', 'johnsardine', 'disbeat', 'pgcmarques', 'nnunobm', 'alexp100' ] | |
problem_id = re.findall('<div class="info-row code-challenge" data-id="(.+?)"', requests.get(problem_url).text)[0] | |
users = dict( [ (u, []) for u in users ] ) | |
for user in users: |
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
class TastypieApiKeyUserMiddleware(object): | |
""" | |
Middleware for per-request authentication with tastypie | |
""" | |
# Name of request header to grab username from. This will be the key as | |
# used in the request.META dictionary, i.e. the normalization of headers to | |
# all uppercase and the addition of "HTTP_" prefix apply. | |
header = 'HTTP_AUTHORIZATION' | |
method = 'apikey' | |
apikey_auth = ApiKeyAuthentication() |
OlderNewer