Skip to content

Instantly share code, notes, and snippets.

View biancadanforth's full-sized avatar

Bianca Danforth biancadanforth

View GitHub Profile
@biancadanforth
biancadanforth / cfrRecipe.js
Last active October 4, 2017 23:52
CFR Recipe
const cfrRecipe = {
triggers: {
// what user behaviors trigger the UI presentation
},
presentation: {
defaultComponent: {
// what do all major UI elements, sidebar, notification bar, doorhanger use
icon: '',
header: '',
summary: '',
@biancadanforth
biancadanforth / mach try run for Shield Study
Last active January 31, 2018 21:22
./mach try -p linux64,win64,macosx64 -u all -t all --artifact
bdanforth ~/src/mozilla-unified $ ./mach try -p linux64,win64,macosx64 -u all -t all --artifact
You asked for |-u all| with |--artifact| but compiled-code tests (cppunit,gtest,jittest) can't run against an artifact build. Running (-u crashtest,firefox-ui-functional,mochitests,reftest,jsreftest,web-platform-tests,marionette,xpcshell,marionette-e10s) instead.
Creating temporary commit for remote...
pushing to ssh://hg.mozilla.org/try
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 2 changesets with 1 changes to 26 files (+1 heads)
remote: recorded push in pushlog
@biancadanforth
biancadanforth / gist:d47411e410cc5987014864c7a3354ca8
Created January 31, 2018 21:59
./mach try -p linux64,win64,macosx64 -u all -t all --artifact
bdanforth ~/src/mozilla-unified $ ./mach try -p linux64,win64,macosx64 -u all -t all --artifact
You asked for |-u all| with |--artifact| but compiled-code tests (cppunit,gtest,jittest) can't run against an artifact build. Running (-u crashtest,firefox-ui-functional,mochitests,reftest,jsreftest,web-platform-tests,marionette,xpcshell,marionette-e10s) instead.
Creating temporary commit for remote...
pushing to ssh://hg.mozilla.org/try
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 6 changesets with 6 changes to 5 files (+1 heads)
remote: recorded push in pushlog
@biancadanforth
biancadanforth / addonInfo.json
Last active July 26, 2018 01:03
Gets add-on Normandy slug and XPI endpoint from the Normandy API (filtering for studies that use 'isFirstRun' in their recipes) and add-on size from AWS, outputting the join to addonInfo.json
{"https://net-mozaws-prod-us-west-2-normandy.s3.amazonaws.com/extensions/tracking-protection-messaging-study-new-users%40shield.mozilla.org-1.0.8-signed.xpi":{"slug":"addon-tracking-protection-messaging-1433473-new-users","addonSize":"142530"},"https://net-mozaws-prod-us-west-2-normandy.s3.amazonaws.com/extensions/pioneer-enrollment-study%40mozilla.org-2.0.4-signed.xpi":{"slug":"Pioneer Enrollment","addonSize":"153385"},"https://net-mozaws-prod-us-west-2-normandy.s3.amazonaws.com/extensions/pug.experience.mrrobotshield.mozilla.org-1.0.4-signed.xpi":{"slug":"looking-glass-2","addonSize":"12956"},"https://net-mozaws-prod-us-west-2-normandy.s3.amazonaws.com/extensions/focused-cfr-shield-studymozilla.com-1.0.1-signed.xpi":{"slug":"focused-cfr-beta-1","addonSize":"104589"},"https://net-mozaws-prod-us-west-2-normandy.s3.amazonaws.com/extensions/unified-urlbar-shield-study-opt-out-new-users-3.0.6-signed.xpi":{"slug":"unfied-search-release-new-users-1387245","addonSize":"31515"}}
@biancadanforth
biancadanforth / CommitMessage.md
Last active July 23, 2018 16:18
Adding Jest and a simple Jest test to a WebExtension that uses React and Webpack (ignoring package-lock.json), originally from mozilla/webext-commerce

Fix #28: WIP - Add initial Jest test for a React component.

Builds off PR #26.

  • Adds Jest/Enzyme and the first part of a simple React component test, which can be executed via 'npm run test'.
  • Adds eslint rules for Jest
  • Adds new devDeps:
    • babel-jest: Compiles JS code using Babel in Jest tests; this means Babel is run on any files loaded by Jest (and these files are transformed based on .babelrc).
    • babel-preset-env: Compiles ES2015+ down to ES5. Currently this is so we can use 'import' in Node.js for the Jest tests (Jest runs in Node); we add additional rules in .babelrc so that we only perform Babel transforms that are needed for the current Node environment, rather than transforming everything to ES5, which is not needed for Firefox.
  • enzyme: JS testing library for React
@biancadanforth
biancadanforth / links.md
Created August 28, 2018 15:58
Links for interviewing 08-28-18
// From https://www.coursera.org/learn/algorithms-divide-conquer/home/welcome
// Assignment: https://www.coursera.org/learn/algorithms-divide-conquer/exam/srsxO/programming-assignment-1
/**
* Assignment: Implement a recursive integer multiplication and/or Karatsuba's
* algorithm to compute the product of the following two 64-digit numbers:
* - 3141592653589793238462643383279502884197169399375105820974944592
* - 2718281828459045235360287471352662497757247093699959574966967627
* Constraints:
* - Multiply only pairs of single digit numbers
// Course: https://www.coursera.org/learn/algorithms-divide-conquer/home/welcome
// Assignment: https://www.coursera.org/learn/algorithms-divide-conquer/exam/YLbzP/programming-assignment-2
/**
* Maximum number of inversions: "n choose 2", where n = 100000; i.e. if array of numbers were
* sorted in descending order (worst case scenario), rather than ascending (best case scenario,
* 0 inversions).
* "n choose 2" = [n * (n - 1)]/2
*/
@biancadanforth
biancadanforth / Algorithms Coursera Programming Assignment 3.js
Last active January 21, 2019 04:08
Algorithms Coursera Programming Assignment 3.js
// Course: https://www.coursera.org/learn/algorithms-divide-conquer/home/welcome
// Assignment: https://www.coursera.org/learn/algorithms-divide-conquer/exam/YLbzP/programming-assignment-3
/* eslint-env node */
/**
* Download the following text file: QuickSort.txt
* The file contains all of the integers between 1 and 10,000
* (inclusive, with no repeats) in unsorted order. The integer
* in the ith row of the file gives you the ith entry of an
* input array.
*
@biancadanforth
biancadanforth / Algorithms Coursera Programming Assignment 4.js
Last active January 26, 2019 05:13
Algorithms Coursera Programming Assignment 4.js
/* eslint-env node */
/**
* The file contains the adjacency list representation of a simple
* undirected graph. There are 200 vertices labeled 1 to 200. The
* first column in the file represents the vertex label, and the
* particular row (other entries except the first column) tells all
* the vertices that the vertex is adjacent to. So for example, the
* 6th row looks like : "6 155 56 52 120 ...". This just means that
* the vertex with label 6 is adjacent to (i.e., shares an edge with)
* the vertices with labels 155,56,52,120, etc.