Skip to content

Instantly share code, notes, and snippets.

Gregg Lind gregglind

Block or report user

Report or block gregglind

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View cep-all-shield-addons-counts.lua
--
-- General Filter for 'seen today' for all Study and Shield addons
--
--
require "cjson"
require "hyperloglog"
require "string"
View 201.history.txt
Name: Shield Study 13 - Net Neutrality
Type: show-heartbeat
{ engagementButtonLabel: 'Get it now',
includeTelemetryUUID: true,
learnMoreMessage: 'Learn More',
learnMoreUrl: 'https://wiki.mozilla.org/Firefox/Shield/Shield_Studies',
message: 'Want to try something new in Firefox?',
postAnswerUrl: 'https://addons.mozilla.org/firefox/shield_study_13',
repeatOption: 'once',
View 201.history.txt
Name: Shield Study 13 - Net Neutrality
Type: show-heartbeat
{ engagementButtonLabel: 'Get it now',
includeTelemetryUUID: true,
learnMoreMessage: 'Learn More',
learnMoreUrl: 'https://wiki.mozilla.org/Firefox/Shield/Shield_Studies',
message: 'Want to try something new in Firefox?',
postAnswerUrl: 'https://addons.mozilla.org/firefox/shield_study_13',
repeatOption: 'once',
@gregglind
gregglind / hackyStravaLapData.js
Created Jun 19, 2017
Getting Lap Data out of Strava
View hackyStravaLapData.js
window.NodeList.prototype.map = Array.prototype.map;
function floatTime (s) { f=s.split(':').map(Number); return f[0] + f[1]/60}
console.log(document.querySelectorAll('.mile-splits tbody tr').map(node=>node.querySelector('td:nth-child(2)').firstChild.data).map(floatTime).join("\n"))
@gregglind
gregglind / bootstrap.js
Created Apr 26, 2017
A bootstrap file for a simple pref flip study helper addon
View bootstrap.js
// https://github.com/gregglind/quantum-preference-telemetry-annotation-pretender/blob/master/index.js
const CID = Cu.import('resource://gre/modules/ClientID.jsm');
const { TelemetryController } = Cu.import('resource://gre/modules/TelemetryController.jsm');
const { TelemetryEnvironment } = Cu.import('resource://gre/modules/TelemetryEnvironment.jsm');
function generateTelemetryIdIfNeeded() {
let id = TelemetryController.clientID;
/* istanbul ignore next */
@gregglind
gregglind / promiseAll.josh.js
Created Mar 1, 2017
Promises, and loading the files
View promiseAll.josh.js
function waitUp(t) {
window.setTimeout(()=>console.log("waited", t),t)
}
waitUp.bind(null, 100)()
function loadAFile(url) {
return new Promise(function (resolve, reject){
// simulate unknown wait time
@gregglind
gregglind / s-s-a.lua
Last active Feb 14, 2017
shield-studies-addons prototype job
View s-s-a.lua
filename = "s3_parquet.lua"
message_matcher = "Type == 'telemetry' && Fields[docType] == 'shield-study-addon'"
ticker_interval = 60
preserve_data = false
parquet_schema = [=[
message shield-study-addon {
required group application {
optional group addons {
optional group activeAddons (MAP) {
@gregglind
gregglind / gist:b4ecc56197b127e6e7cac93b0166ae69
Created Jan 25, 2017
Automatic Conversions of Mozilla Data Schemas using `jsonschema-parquet`
View gist:b4ecc56197b127e6e7cac93b0166ae69
$ jsonschema-parquet parquet --deref ~/gits/mozilla-pipeline-schemas/telemetry/*
message core.schema.json {
required binary arch (UTF8);
required binary clientId (UTF8);
required binary device (UTF8);
optional binary experiments (UTF8);
required binary locale (UTF8);
required binary os (UTF8);
required binary osversion (UTF8);
@gregglind
gregglind / shield-format.parquet.txt
Last active Jan 24, 2017
Parquet Schemas For Shield Studies
View shield-format.parquet.txt
message shield-study-addon {
required int64 version;
required binary study_name (UTF8);
required binary branch (UTF8);
required binary addon_version (UTF8);
required binary shield_version (UTF8);
optional boolean testing;
required group data {
required binary type (UTF8);
required group attributes (MAP) {
@gregglind
gregglind / talk, log.
Created Jan 17, 2017
jetpack (addon-sdk frames) don't share constructors, busting instanceOf
View talk, log.
20:20 < gregglind> Sorry to ask Jetpack questions :(
20:20 < gregglind> is `instanceof Object` ... reliable or funky across modules in jetpacks?
20:21 < gregglind> i have observed that Error is funky as well.
20:21 < gregglind> I am not even sure how to phrase it.
20:25 < The_8472> each module has its own global, including separate instances of the primordial types such as Object, Error, etc.
20:26 < The_8472> (foo !== null && typeof foo === "object") to check for objectness
20:27 < The_8472> or you can export the constructor function from that module
20:28 < The_8472> then foo instanceof MyClass should work. i think.
20:29 < gregglind> The_8472: different frames :)
20:29 < The_8472> yes, same thing
You can’t perform that action at this time.