Skip to content

Instantly share code, notes, and snippets.

View Osmose's full-sized avatar

Osmose Osmose

View GitHub Profile
(function($) {
'use strict';
var $window = $(window);
var $document = $(document);
var $body = $('body');
var $nav = $('#page-nav');
var $navList = $('#page-nav-list');
// Add a class to use as a style hook when JavaScript is available
$body.addClass('js');
{% macro facebook_share_url(url) -%}
{{ 'https://www.facebook.com/sharer/sharer.php?u=%s'|f(url|urlencode)|e }}
{%- endmacro %}
{% macro twitter_share_url(url, tweet_text) -%}
{{ 'https://www.twitter.com/intent/tweet?url=%s&text=%s'|f(url|urlencode, tweet_text|urlencode)|e }}
{%- endmacro %}
<a href="{{ facebook_share_url('https://firefoxflicks.org') }}" class="share-facebook">
<a href="{{ twitter_share_url('https://firefoxflicks.org', _('Tweet text')) }}" class="share-twitter">
@Osmose
Osmose / view_func_and_view_class_decorator.py
Last active December 11, 2015 17:58
Does some nasty stuff in order to decorate either a view function or a class-based view. Not sure if I'll actually use it.
from functools import partial, wraps
from inspect import isclass
from django.contrib.auth.decorators import login_required
from django.shortcuts import redirect
from django.utils.decorators import method_decorator
from django.views.generic import View
class profile_required(object):
# On branch new-mwc
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# new file: apps/firefox/templates/firefox/partners/landing.html
# new file: apps/firefox/templates/firefox/partners/partners-base.html
# modified: apps/firefox/urls.py
# modified: etc/httpd/global.conf
# new file: media/css/partners.less
# modified: media/css/sandstone/sandstone-resp.less
;(function($, Modernizr, _gaq, site) {
'use strict';
if (site.platform === 'android') {
return;
}
// Load images on load so as not to block the loading of other images.
$(window).on('load', function() {
// Replace install images depending on the user's platform.
Download Firefox (Large Firefox logo rising in front of an orange background)
Download Firefox (Small Firefox logo on a light blue background)
Download Firefox (Large Firefox logo resting on a light blue background)
Download Firefox (For Android. A mobile phone in front of a faded Firefox logo with a light blue background)
Download Firefox (For Android. A mobile phone displaying a large Firefox logo on its screen, over a light blue background)
Download Firefox (For Android. Firefox logo floating over a mobile phone resting on an orange background)
>>> def _(str):
... return str
...
>>> """
... - translation
... - contact
... - auto-answer email, None if manual answer
... """
'\n- translation\n- contact\n- auto-answer email, None if manual answer\n'
>>> FUNCTIONAL_AREAS = {
{
"user": "mkelly",
"project": "test",
"content": "Stanupd test! #mozilla.org blah blah",
"api_key": "qwertyuiopasdfghjklzxcvbnm1234567890"
}
Index: .htaccess
===================================================================
--- .htaccess (revision 108295)
+++ .htaccess (working copy)
@@ -229,7 +229,7 @@
RewriteRule ^(\w{2,3}(?:-\w{2}(?:-mac)?)?/)?firefox/video/firefox-3.5.html$ /$1firefox/video/?video=meet [R=permanent]
# Bug 479262
-RewriteRule ^(?:en-US/)?university/?(?:index.html)?$ https://wiki.mozilla.org/Education [R=permanent]
+RewriteRule ^(?:en-US/)?university/?(?:index.html)?$ https://blog.mozilla.org/university/ [R=permanent]
(function($) {
// Handle submission of the account linking form.
$(document).on('submit', '#account-link-form', function(e) {
e.preventDefault();
var $form = $(this);
var url = $form.attr('action');
$.ajax({
type: 'POST',