Skip to content

Instantly share code, notes, and snippets.

View Osmose's full-sized avatar

Osmose Osmose

View GitHub Profile
@Osmose
Osmose / youtube_severals.user.js
Last active December 22, 2023 18:07
A Tampermonkey script that makes Youtube metrics healthier
// ==UserScript==
// @name Youtube Severals
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Replace like and subscribe and comment counts with severals
// @author Osmose
// @updateUrl https://gist.github.com/Osmose/eecbfdcfa534489c3a6f4b7ac97c7e25/raw/youtube_severals.user.js
// @downloadUrl https://gist.github.com/Osmose/eecbfdcfa534489c3a6f4b7ac97c7e25/raw/youtube_severals.user.js
// @match https://www.youtube.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=youtube.com
switch (true) {
case "a".match(/a/): {
console.log("first");
break;
}
default: {
console.log("default");
break;
}
}
diff --git a/docker/Dockerfile b/docker/Dockerfile
index 3353e8c6f..84d802a1c 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -50,9 +50,12 @@ COPY . /app/
# static files
RUN cd /app/webapp-django/ && python manage.py collectstatic --noinput
+# app should own everything under /app in the container
+RUN chown -R app.app /app
def should_notify_florian(user, event, issue):
# is_new means is this the first event for this issue
return not user.has_been_notified_about(issue) and issue.is_new and event.module in [
'resource://file/i/own.jsm'
]
def should_notify_top_crasher(user, event, issue):
app_build_id = get_latest_build_id()
return not user.has_been_notified_about(issue) and issue.get_rank(app_build_id=app_build_id) <= 10
@Osmose
Osmose / test.md
Last active September 20, 2017 22:31
Testing Filter Expressions in the Browser Console
  1. Open the DevTools and go into the settings via the Gear Icon

  2. Ensure "Enable browser chrome and add-on debugging toolboxes" is checked.

  3. Open the browser console

    • Tools > Web Developer > Browser Console
    • Cmd + Shift + J
  4. Run the following in the console:

    Cu.import("resource://shield-recipe-client/lib/RecipeRunner.jsm", {}).RecipeRunner.checkFilter({

id: 1,

https://treeherder.mozilla.org/index.html#/jobs?repo=autoland&fromchange=9f3981bb36b476125ca5764908c9f94ea6fe1e97&tochange=87a67b8573623763cc882454fba1b9dc06317839
<html>
<body>
<script src="https://rawgit.com/Osmose/2fc79a949ea5ebbc3163ff51ac99ac40/raw/5dd9a74cd0f5e91d173bf8aa1a1845bc8a0873a1/script1.js"></script>
<script src="https://rawgit.com/Osmose/2fc79a949ea5ebbc3163ff51ac99ac40/raw/5dd9a74cd0f5e91d173bf8aa1a1845bc8a0873a1/script2.js"></script>
</body>
</html>
@Osmose
Osmose / normandy_honcho.md
Created June 22, 2017 20:51
How to run Normandy via Honcho

How to run Normandy via Honcho

  1. pip install honcho

  2. Set up autograph

  3. Save this as a Procfile in normandy/recipe-server:

    web: bash ./bin/runsslserver.sh
    webpack: npm run watch -- --update-actions
    

autograph: autograph -c /Users/mkelly/go/src/go.mozilla.org/autograph/autograph.yaml

diff --git a/toolkit/modules/GMPInstallManager.jsm b/toolkit/modules/GMPInstallManager.jsm
--- a/toolkit/modules/GMPInstallManager.jsm
+++ b/toolkit/modules/GMPInstallManager.jsm
@@ -99,17 +99,17 @@ GMPInstallManager.prototype = {
let certs = null;
if (!Services.prefs.prefHasUserValue(GMPPrefs.KEY_URL_OVERRIDE)) {
allowNonBuiltIn = !GMPPrefs.get(GMPPrefs.KEY_CERT_REQUIREBUILTIN, true);
if (GMPPrefs.get(GMPPrefs.KEY_CERT_CHECKATTRS, true)) {
certs = gCertUtils.readCertPrefs(GMPPrefs.KEY_CERTS_BRANCH);
}