Skip to content

Instantly share code, notes, and snippets.

View jaredhirsch's full-sized avatar
🙃
mostly working in mozilla repositories these days

Jared Hirsch jaredhirsch

🙃
mostly working in mozilla repositories these days
View GitHub Profile
@jaredhirsch
jaredhirsch / asound.state
Created March 10, 2023 13:03
Scarlett 18i6 alsa asound.state file, generated on ubuntu 22
state.PCH {
control.1 {
iface MIXER
name 'Headphone Playback Volume'
value.0 0
value.1 0
comment {
access 'read write'
type INTEGER
count 2
@jaredhirsch
jaredhirsch / gecko-cpp.md
Last active May 6, 2024 23:28
My notes from the C++ and Gecko onboarding video

These notes are based on the 2016? Mozilla C++ and Gecko onboarding presentation by froydnj: https://mozilla.hosted.panopto.com/Panopto/Pages/Embed.aspx?id=65922cea-26e0-4d3b-a5da-ac1600012f45

The original slides are still available, which link off to some historical MDN pages (you can find them on the internet archive in many cases): https://docs.google.com/presentation/d/1ZHUkNzZK2TrF5_4MWd_lqEq7Ph5B6CDbNsizIkBxbnQ/edit#slide=id.p


Basic topics to cover:

  • Subsystems in Gecko
  • XPCOM strings and datatypes
@jaredhirsch
jaredhirsch / foo.md
Last active November 6, 2019 23:53
attaching debuggers to things

(Note: I moved this info into the main FxA readme at https://github.com/mozilla/fxa.)

Attaching a debugger to a running node process, sadly, requires running google chrome (AFAIK).

How to do it:

  1. Start google chrome and open up chrome://inspect.

  2. Run a node process using the --inspect or --inspect-brk flags (see specific command-line incantations below)

@jaredhirsch
jaredhirsch / ugh
Created July 9, 2019 22:57
fxa monorepo npm install = node-gyp dumpster fires
[15:51:37 mozilla-fxa (mozilla-master) ]$ npm install
> [email protected] postinstall /Users/jh/codez/github/mozilla-fxa
> _scripts/postinstall.sh
+ '[' '' = true ']'
+ _scripts/install_all.sh
+ _scripts/check.sh
++ which rustup
+ [[ ! -n /Users/jh/.cargo/bin/rustup ]]
running: "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "src/libbacktrace" "-I" "/Users/jh/codez/github/mozilla-fxa/packages/fxa-email-service/target/debug/build/backtrace-sys-a925084960b3e8d2/out" "-fvisibility=hidden" "-DBACKTRACE_SUPPORTED=1" "-DBACKTRACE_USES_MALLOC=1" "-DBACKTRACE_SUPPORTS_THREADS=0" "-DBACKTRACE_SUPPORTS_DATA=0" "-DHAVE_DL_ITERATE_PHDR=1" "-D_GNU_SOURCE=1" "-D_LARGE_FILES=1" "-Dbacktrace_full=__rbt_backtrace_full" "-Dbacktrace_dwarf_add=__rbt_backtrace_dwarf_add" "-Dbacktrace_initialize=__rbt_backtrace_initialize" "-Dbacktrace_pcinfo=__rbt_backtrace_pcinfo" "-Dbacktrace_syminfo=__rbt_backtrace_syminfo" "-Dbacktrace_get_view=__rbt_backtrace_get_view" "-Dbacktrace_release_view=__rbt_backtrace_release_view" "-Dbacktrace_alloc=__rbt_backtrace_alloc" "-Dbacktrace_free=__rbt_backtrace_free" "-Dbacktrace_vector_finish=__rbt_backtrace_vector_finish" "-Dbacktrace_vector_grow=__rbt_backtrace_vector_grow" "-Dbacktrace_vector_release=__rbt_backtrace_vector_release" "-Dbacktr
@jaredhirsch
jaredhirsch / :-(
Created July 9, 2019 22:17
fxa-auth-server: trying to install on node 10.16.0 / mac 10.14.5
[15:15:11 fxa-auth-server (mozilla-master) ]$ npm install
> @newrelic/[email protected] install /Users/jh/codez/github/mozilla-fxa/packages/fxa-auth-server/node_modules/@newrelic/native-metrics
> node ./lib/pre-build.js install native_metrics
> /usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js clean configure
> /usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build -j 6 native_metrics
CXX(target) Release/obj.target/native_metrics/src/native_metrics.o
CXX(target) Release/obj.target/native_metrics/src/GCBinder.o
CXX(target) Release/obj.target/native_metrics/src/LoopChecker.o
@jaredhirsch
jaredhirsch / foo
Created July 9, 2019 16:01
fxa-js-client errors after npm setup && npm test without separately installing intern-geezer
[09:00:49 fxa-js-client (mozilla-master) ]$ npm run test
> [email protected] test /Users/jh/codez/github/mozilla-fxa/packages/fxa-js-client
> grunt test
Running "intern:node" (intern) task
DEBUG: 'failed to load resource (/Users/jh/codez/github/mozilla-fxa/packages/fxa-js-client/node_modules/intern-geezer/node_modules/dojo/_base/array.js)'
DEBUG: { Error: ENOENT: no such file or directory, open '/Users/jh/codez/github/mozilla-fxa/packages/fxa-js-client/node_modules/intern-geezer/node_modules/dojo/_base/array.js'
at Object.openSync (fs.js:443:3)
at Object.readFileSync (fs.js:343:35)
@jaredhirsch
jaredhirsch / foo.diff
Created January 26, 2019 00:36
Converting hostname to login title: the PSL approach
commit d67700eadc05178d275d526bd696f2dacaf83221
Author: Jared Hirsch <[email protected]>
Date: Tue Jan 22 16:21:23 2019 -0800
Add Logins API utility method to get domain name, minus TLD, from a URL
diff --git a/src/experiments/logins/api.js b/src/experiments/logins/api.js
index 15dbf53..71412a2 100644
--- a/src/experiments/logins/api.js
+++ b/src/experiments/logins/api.js
@jaredhirsch
jaredhirsch / foo.md
Created October 24, 2017 18:22
debugging is fun yay

this is webpack require 8 in studyutils.jsm, beautified:

module.exports = {
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "study setup",
    "type": "object",
    "definitions": {
        "idString": {
            "description": "between 1,100 chars, no spaces, unicode ok.",
@jaredhirsch
jaredhirsch / foo.md
Created August 10, 2017 16:27
Screenshots - Bug 1387598 / Intermittent sessionrestore_no_auto_restore | application crashed [@ GetNameOperation]

I got pinged on bug 1387598, some Windows-only crashes in a Talos test that deliberately prevents the sessionstore-windows-restored event from firing. Screenshots 10.10 seemed to cause the regression. (As a reminder, 10.10 includes a fix to synchronize startup and shutdown, see discussion in screenshots pull request #3260.)

Looking at the Talos test definition on dxr, it appears that the test causes the event to never fire:

# inside mozilla-central/testing/talos/talos/test.py, revision 4c5fbf493763, line 181:

@register_test()
class sessionrestore_no_auto_restore(sessionrestore):
    """