Skip to content

Instantly share code, notes, and snippets.

@rhelmer
rhelmer / gist:b18f50f668b0d6336997c30f6727dcfd
Last active April 26, 2024 21:56
WIP moving shield-addon-utils in-tree
diff --git a/toolkit/components/extensions/ext-toolkit.json b/toolkit/components/extensions/ext-toolkit.json
--- a/toolkit/components/extensions/ext-toolkit.json
+++ b/toolkit/components/extensions/ext-toolkit.json
@@ -152,6 +152,14 @@
["runtime"]
]
},
+ "study": {
+ "url": "chrome://extensions/content/parent/ext-study.js",
+ "schema": "chrome://extensions/content/schemas/study.json",
# HG changeset patch
# User Robert Helmer <rhelmer@mozilla.com>
# Date 1566713264 25200
# Sat Aug 24 23:07:44 2019 -0700
# Node ID fff97a76d75a6d0cd71e6c3dc30fe9d02bf0010c
# Parent 5c329d928cb98e1d7e5973490a2e1592500f0ce5
Bug WIP - add new FirstStartup service and --first-startup post-install flag.
FirstStartup provides an optional mechanism to run synchronous services
before the UI appears. This is intended to be called as a post-install
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
ChromeUtils.import("resource://gre/modules/Services.jsm");
const ENABLE_PROB = 0.01;
const ADDON_ID = "telemetry-coverage-bug1487578@mozilla.org";
const TOTAL_SAMPLES = 100000;
Cu.importGlobalProperties(["crypto", "TextEncoder"]);
XPCOMUtils.defineLazyServiceGetters(this, {
diff --git a/browser/components/BrowserContentHandler.jsm b/browser/components/BrowserContentHandler.jsm
--- a/browser/components/BrowserContentHandler.jsm
+++ b/browser/components/BrowserContentHandler.jsm
@@ -19,6 +19,7 @@ XPCOMUtils.defineLazyModuleGetters(this,
BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm",
HeadlessShell: "resource:///modules/HeadlessShell.jsm",
HomePage: "resource:///modules/HomePage.jsm",
+ FirstStartup: "resource://gre/modules/FirstStartup.jsm",
LaterRun: "resource:///modules/LaterRun.jsm",
PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.jsm",
@rhelmer
rhelmer / gist:b075f21f44f3e98579b1
Last active November 1, 2022 12:13
herokuish build+deploy using LXC

Introduction

Heroku differs from traditional build & deploy by having the concept of "buildpacks", which are a generic method to identify, compile and package builds. The traditional method here would be to have hardcoded build commands, in a Makefile for instance. Buildpacks generally make custom build+deploy steps uneccessary, although one can specify custom buildpacks if necessary.

When notifying Heroku that a deploy is needed (usually by a Github webook), Heroku will run through all supported buildpacks until one can identify your app, which is then compiled and packaged by the buildpack. The output of this process is referred to as a "slug", which contains your app and all dependencies. For instance, a Python app would have the virtualenv packaged inside it. Heroku automatically deploys slugs that are built successfully.

This document describes a way to use LXC and existing third-party tools to reproduce this setup.

You need to have a server running that accepts webhooks and can take act

@rhelmer
rhelmer / about:pioneer injection API
Created September 2, 2020 16:10
pioneer_injection.diff
diff --git a/experiment-apis/pioneer.js b/experiment-apis/pioneer.js
new file mode 100644
index 0000000..fe7cb0e
--- /dev/null
+++ b/experiment-apis/pioneer.js
@@ -0,0 +1,96 @@
+/* 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/. */
+
{
"type": "object",
"properties": {
"addon_id": {
"type": "string"
},
"icons": {
"type": "object",
"properties": {
"32": {
[
{
addon_id: "pioneer-v2-example@mozilla.org",
icons: {
"32":
"https://localhost/user-media/addon_icons/2644/2644632-32.png?modified=4a64e2bc",
"64":
"https://localhost/user-media/addon_icons/2644/2644632-64.png?modified=4a64e2bc",
"128":
"https://localhost/user-media/addon_icons/2644/2644632-128.png?modified=4a64e2bc",
{
"messages": [
{
"content": {
"text": "Donate your data to science with <link0>Firefox Pioneer</link0>",
"icon": "https://snippets.cdn.mozilla.net/media/icons/1a8bb10e-8166-4e14-9e41-c1f85a41bcd2.png",
"button_label": "Button Label",
"section_title_icon": "https://snippets.cdn.mozilla.net/media/icons/5878847e-a1fb-4204-aad9-09f6cf7f99ee.png",
"section_title_text": "Messages from Firefox",
"section_title_url": "https://support.mozilla.org/kb/snippets-firefox-faq?utm_source=desktop-snippet&utm_medium=snippet&utm_campaign=&utm_term=&utm_content=",
{
"messages": [
{
"content": {
"scene1_button_label": "Se connecter à Sync",
"scene1_button_color": "#f05",
"scene2_dismiss_button_text": "Supprimer",
"scene2_button_label": "Continuer",
"scene2_email_placeholder_text": "Votre adresse électronique",
"form_action": "https://basket.mozilla.org/subscribe.json",