Skip to content

Instantly share code, notes, and snippets.

<aside class="sticky-promo" id="sticky-promo">\n <button type="button" class="sticky-promo-close" id="sticky-promo-close"><span>Close</span></button>\n
<p>Meet our family of products.</p>\n
<hr>\n
<ul>\n
<li>
<a href="https://www.mozilla.org/firefox/browsers/" data-cta-type="cro-sticky-card-suite" data-cta-text="browsers" data-cta-position="v1"><img src="https://www.mozilla.org/media/cro_exp/img/hlockup/browser-white.png" alt="Firefox Browser"></a>
</li>\n
<li>
<a href="https://monitor.firefox.com/?utm_source=www.mozilla.org&utm_medium=referral&utm_campaign=CRO-sticky-promo" data-cta-type="cro-sticky-card-suite" data-cta-text="monitor" data-cta-position="v1"><img src="https://www.mozilla.org/media/cro_exp/img/hlockup/monitor-white.png" alt="Firefox Monitor"></a>
</li>\n
@hoosteeno
hoosteeno / mozilla-sync-button.js
Last active November 6, 2019 19:29
Note the addition of the experiment parameters line59 and 63, which we will use to track experiment performance.
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// create namespace
if (typeof window.Mozilla === 'undefined') {
window.Mozilla = {};
}
(function() {
// https://gist.github.com/hoosteeno/aeabac67db5a57817c4070df8f8f7a80
function onFormSubmit(e) {
var dest = 'anemail@example.com';
var values = e.values;
var s = SpreadsheetApp.getActiveSheet();
var headers = s.getRange(1,1,1,s.getLastColumn()).getValues()[0];
var subject = "#Incoming " + values[2].substring(0,68); // max subject length 78 chars
var message = "";
# make new bedrock db environment work on osx
brew install coreutils
PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
./bin/sync-all.sh
var $oldList = $('.download-list');
var $nowList = $oldList.clone();
var $laterList = $oldList.clone();
var $style = $('<style>'
+ '.download-list {'
+ 'float:left;'
+ '}'
+ '.download-list:first-of-type {'
+ 'margin-right: 30px;'
@hoosteeno
hoosteeno / index.js
Created April 27, 2016 16:57
metalsmith-devonly plugin
const devonly = function(plugin, options) {
if (process.argv.length > 2 && process.argv.indexOf('dev') > 0) {
return plugin(options);
}
else {
return function(files, metalsmith, done) {
done();
};
}
};
---
model:
conferences: conferences
this_conf: berlin
---
<ul>
{% for conference in model.conferences %}
<li>
if on_device:
# this event tells input's javascript that we
# are on fennec and came via a feedback prompt
fire_event = ('var e = document.createEvent("Events");'
'e.initEvent("FeedbackPrompted", true, false);'
'document.dispatchEvent(e);')
self.selenium.execute_script(fire_event)
// doesn't work: frontmatter isn't substituted for template tags
.use(inplace({
engine: 'nunjucks',
pattern: '*.html',
directory: './source/extra_dir'
}))
// doesn't work: throws a template error on build
.use(inplace({
engine: 'nunjucks',
query.list <- Init(start.date = "2015-11-03",
end.date = "2015-12-14",
metrics="ga:users,ga:sessions,ga:goal1ConversionRate,ga:goal2ConversionRate,ga:goal3ConversionRate,ga:bounceRate,ga:goal3Completions",
dimensions = "ga:date,ga:browser,ga:browserVersion,ga:eventLabel,ga:eventCategory,ga:source",
max.results = 10000,
sort = "-ga:users",
table.id = table.id)
ga.query <- QueryBuilder(query.list)
return(GetReportData(ga.query, token, split_daywise = T))