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 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() |
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 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 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 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> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta content="yes" name="apple-mobile-web-app-capable"> | |
<title>iOS Web App</title> | |
<!-- iPhone --> |
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
@media only screen and (min-width: 320px) { | |
/* Small screen, non-retina */ | |
} | |
@media | |
only screen and (-webkit-min-device-pixel-ratio: 2) and (min-width: 320px), | |
only screen and ( min--moz-device-pixel-ratio: 2) and (min-width: 320px), | |
only screen and ( -o-min-device-pixel-ratio: 2/1) and (min-width: 320px), |
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
/** | |
* CSS Pebbles! | |
*/ | |
html { | |
background: url("http://michaeliahotel.com/img/sand.jpg"); | |
min-height: 100%; | |
} | |
.aside-icons { |
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
/** | |
* CSS Pebbles! | |
*/ | |
html { | |
background: url("http://michaeliahotel.com/img/sand.jpg"); | |
min-height: 100%; | |
} | |
.aside-icons { |
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
/** | |
* drop-shadow filter vs box-shadow | |
*/ | |
html { | |
background: url('http://subtlepatterns.com/patterns/purty_wood.png') | |
} | |
.speech-bubble { | |
position: relative; |
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
/* Image interpolation demo */ | |
@keyframes browsers { | |
from, to { background-image: url('http://lea.verou.me/css-4d/img/firefox-logo.png'); } | |
20% { background-image: url('http://lea.verou.me/css-4d/img/chrome-logo.png'); } | |
40% { background-image: url('http://lea.verou.me/css-4d/img/safari-logo.png'); } | |
60% { background-image: url('http://lea.verou.me/css-4d/img/opera-logo.png'); } | |
80% { background-image: url('http://lea.verou.me/css-4d/img/ie-logo.png'); } | |
} |
NewerOlder