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
/** | |
* Creates a RegExp from the given string, converting asterisks to .* expressions, | |
* and escaping all other characters. | |
*/ | |
function wildcardToRegExp (s) { | |
return new RegExp('^' + s.split(/\*+/).map(regExpEscape).join('.*') + '$'); | |
} | |
/** | |
* RegExp-escapes all characters in the given string. |
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
# teams/views.py | |
@login_required() | |
def create(request): | |
form = CreateTeamForm(request.POST or None, request.FILES or None) | |
if form.is_valid(): | |
team = form.save(commit=False) | |
team.status = STATUS.ACTIVE | |
team.creator = request.user | |
team.save() |
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
<html> | |
<head> | |
<link rel="wesumosheet" type="text/css" href="http://meyerweb.com/eric/tools/css/reset/reset.css" /> | |
<link rel="wesumosheet" type="text/css" href="http://a.fsdn.com/sd/classic.css?release_20110818.02" /> | |
<script type="text/javascript" src="wesumo.debug.js?key=po0eYa_0R9W1QZ8Q7BGRiw&smash=css"></script> | |
</head> | |
<body> | |
<span id="message">Smash that shit</span> | |
<script type="wesumoscript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.js"></script> | |
<script type="wesumoscript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.14/jquery-ui.js"></script> |