Skip to content

Instantly share code, notes, and snippets.

View maxxcrawford's full-sized avatar

Maxx Crawford maxxcrawford

View GitHub Profile
@maxxcrawford
maxxcrawford / normandyDohTestScript-Enable-120.js
Created December 17, 2019 21:56
Run to simulate enrollment in v3 Doh Add-on study, and receive the v1.2.0 of the DoH Rollout add-on ENABLED
{
"id": 883,
"last_updated": "2019-11-28T04:32:58.623288Z",
"name": "DoH US Engagement Study V3",
"enabled": true,
"is_approved": true,
"revision_id": 2853,
"action": "branched-addon-study",
"arguments": {
"branches": [
@maxxcrawford
maxxcrawford / normandyDohTestScript-Disable.js
Last active December 10, 2019 21:49
Run to simulate enrollment in v3 Doh Add-on study, and receive the v1.1.0 of the DoH Rollout add-on DISABLED
{
"id": 883,
"last_updated": "2019-11-28T04:32:58.623288Z",
"name": "DoH US Engagement Study V3",
"enabled": true,
"is_approved": true,
"revision_id": 2853,
"action": "branched-addon-study",
"arguments": {
"branches": [
@maxxcrawford
maxxcrawford / normandyDohTestScript.js
Created December 5, 2019 16:01
Run to simulate enrollment in v2 Helped add-on study, and receive the v1.0.4 of the DoH Rollout add-on
{
"id": 875,
"last_updated": "2019-11-15T21:49:09.103837Z",
"name": "DoH US Engagement Study V2 - Add-on helper",
"enabled": true,
"is_approved": true,
"revision_id": 2821,
"action": "branched-addon-study",
"arguments": {
"branches": [
const arrayStartHour = [
"TimesheetUkWeeklyOnlineModel_TimesheetDetailModels_0__StartHour", "TimesheetUkWeeklyOnlineModel_TimesheetDetailModels_1__StartHour", "TimesheetUkWeeklyOnlineModel_TimesheetDetailModels_2__StartHour", "TimesheetUkWeeklyOnlineModel_TimesheetDetailModels_3__StartHour", "TimesheetUkWeeklyOnlineModel_TimesheetDetailModels_4__StartHour"
];
for (day of arrayStartHour) {
document.getElementById(day).value=9
}
const arrayFinishHour = [
"TimesheetUkWeeklyOnlineModel_TimesheetDetailModels_0__FinishHour", "TimesheetUkWeeklyOnlineModel_TimesheetDetailModels_1__FinishHour", "TimesheetUkWeeklyOnlineModel_TimesheetDetailModels_2__FinishHour", "TimesheetUkWeeklyOnlineModel_TimesheetDetailModels_3__FinishHour", "TimesheetUkWeeklyOnlineModel_TimesheetDetailModels_4__FinishHour"
# Define where build files should go. This places them in the directory
# "obj-ff-dbg" under the current source directory
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-ff-dbg
# Enable debug builds
# ac_add_options --enable-debug
# Get the macOS 10.13 SDK
# ac_add_options --with-macos-sdk=$HOME/SDK-archive/MacOSX10.13.sdk/

Keybase proof

I hereby claim:

  • I am maxxcrawford on github.
  • I am maxxcrawford (https://keybase.io/maxxcrawford) on keybase.
  • I have a public key ASAx6UxPYEkWSJ1k2Ag_sR16mqzrrwMCKQ-c82mATfObrgo

To claim this, I am signing this object:

@maxxcrawford
maxxcrawford / netflix-fba-id-response.html
Created April 1, 2019 18:48
Example script of FB Ad ID implimentation on Netflix.com
<!DOCTYPE html>
<html>
<head>
<script>
module = {};
module.exports=function(){var e={tags:{fb_simplicity_cancelConfirm:{tagHtml:'<img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=829253787145710&amp;ev=Cancel" />',logOnly:!(window.onerror=function(e,t,n,o,a){r("object"==typeof i?i:{},void 0,{msg:e,url:t,line:n,col:o,err:a})}),throttle:"none"},fb_simplicity_homeScreen:{tagHtml:'<img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=829253787145710&amp;ev=ViewContent" />',logOnly:!1,throttle:"once_per_day"},fb_simplicity_nmLanding:{tagHtml:'<img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=829253787145710&amp;ev=NM_landing" />',logOnly:!1,throttle:"once_per_visitor"},fb_simplicity_orderFinal:{tagHtml:'<img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=829253787145710&amp;ev=Purchase&amp;cd[Group_status]=Nantucket" />',logOnly:!1,throttle:"once_per_sess
@maxxcrawford
maxxcrawford / grid-color.js
Created April 1, 2019 14:56
Color selector based on column count
const colors = ['yellow', 'pink', 'blue', 'orange', 'teal']
function colorRows (colCount) {
for (let i = 0; i < items.length; i++) {
const item = items[i]
const row = Math.floor(i / colCount)
const col = i % colCount;
const index = (row + col) % colors.length
item.style.background = colors[index]
}
@maxxcrawford
maxxcrawford / slack-delete.rb
Created December 14, 2018 15:49
slack-delete
require 'net/http'
require 'json'
require 'uri'
@token = 'xoxp-2911992907-2913458192-437162844976-d4d4dc6318ac12ac106ddc357b5f489d'
def list_files
ts_to = (Time.now - 30 * 24 * 60 * 60).to_i # 30 days ago
params = {
token: @token,
@maxxcrawford
maxxcrawford / resize.sh
Created July 31, 2017 00:26
ImageMagick Resize
$ mogrify -quality 80 -resize 256x256 *.jpg
# Resizes all images in directory that end in *.jpg, at 80% quality, and resizes them to 256x256