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
mzl.la/devrel-tools-bug |
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
var authors = [], authorElements = document.querySelectorAll('td.column-coauthors a'); | |
for (var i = 0; i < authorElements.length; ++i){ | |
var author = authorElements[i]; | |
if (authors.indexOf ( author.text ) === -1) { | |
authors.push( author.text ); | |
} | |
}; | |
alert(authors.length); |
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
/* | |
Togglers within articles (i.e.) | |
*/ | |
$('.toggleable').mozTogglers(); |
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
elasticsearch::plugin{'mobz/elasticsearch-head': | |
module_dir => 'head', | |
instances => ['elasticsearch'] | |
} |
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 form_valid(self, form): | |
""" | |
We send our welcome email via celery during complete_signup. | |
So, we need to manually commit the user to the db for it. | |
""" | |
with transaction.commit_on_success(): | |
form.save(self.request) | |
return helpers.complete_social_signup(self.request, | |
self.sociallogin) |
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
{% autoescape false %} | |
{# L10n: This is an email. Whitespace matters! #} | |
{{ _('Hi {username}')|f(username=username) }} | |
{# L10n: This is an email. Whitespace matters! #} | |
{% trans %} | |
Thanks for creating an account on Mozilla Developer Network (MDN) -- a community | |
making great resources for developers like you. | |
{% endtrans %} |
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
/* | |
Track form element events | |
*/ | |
trackFormEvents: function(target) { | |
$(target).on('focus click change', 'input, select, button', function(e) { | |
var data = { | |
category: 'Form events', | |
action: e.type, | |
label: e.target | |
}; |
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 Bid(models.Model): | |
user = models.ForeignKey(User) | |
url = models.URLField() | |
ask = models.DecimalField(max_digits=6, decimal_places=2) | |
offer = models.DecimalField(max_digits=6, decimal_places=2) |
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 BidViewSet(viewsets.ModelViewSet): | |
""" | |
API endpoint for bids. Users can create, update, retrieve, and delete | |
only their own bids. | |
url -- url of an OSS bug or issue | |
""" | |
model = Bid | |
serializer_class = BidSerializer | |
lookup_url_kwarg = 'url' |
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
router = routers.DefaultRouter() | |
router.register(r'bids', views.BidViewSet) |
OlderNewer