Skip to content

Instantly share code, notes, and snippets.

Avatar

Motin motin

View GitHub Profile
View console-export-2020-1-2_10-1-30.txt
Could not map contract ID '@mozilla.org/sharepicker;1' to CID {1201d357-8417-4926-a694-e6408fbedcf8} because no implementation of the CID is registered.
Experiment add-on background.js messaging-system-personalization-experiment-1-addon-treatment@mozilla.org background.js:22:9
Object { config: {…} }
background.js:23:9
Checking study eligibility background.js:70:11
Eligible background.js:53:15
Writing hard-coded score threshold 5000 background.js:86:11
Object { permanentPrivateBrowsing: false }
background.js:72:11
Fetching "cfr-ml-model" bucket contents directly from the remote settings server endpoint background.js:103:17
@motin
motin / openwpm-fork-on-mac.md
Last active May 3, 2019
Running a fork of OpenWPM on your Mac
View openwpm-fork-on-mac.md

Running a fork of OpenWPM on your Mac Natively

OpenWPM is a brilliant piece of software for running large-scale website crawls using a remotely controlled browser (Firefox) instead of utilizing a classic web scraping tool. It can easily be extended to collect any sort of data that a browser can collect and comes pre-configured to collect information regarding fingerprinting-related Javascript executions and first/third-party website traffic. The resulting data ends up in a SQLite database (for smaller data collections) or stored in JSON format in the cloud (for large scale data collections).

This document has moved to https://github.com/mozilla/OpenWPM/wiki/Running-OpenWPM-natively-on-macOS

@motin
motin / ttbwsd-simple-example-mobile.txt
Last active Nov 13, 2018
ttbwsd-simple-example-mobile.txt
View ttbwsd-simple-example-mobile.txt
S 1423
P 1504 1514
P 5
P 1723
@motin
motin / ttbwsd-simple-example-desktop.txt
Created Nov 13, 2018
ttbwsd-simple-example-desktop.txt
View ttbwsd-simple-example-desktop.txt
start 2018-11-13 14:23
pause 15:04->15:14
pause 5min
pause 17:23->
@motin
motin / ttbwsd-advanced-example-desktop.txt
Last active Nov 13, 2018
ttbwsd-advanced-example-desktop.txt
View ttbwsd-advanced-example-desktop.txt
start 2018-11-13 (+0200) 14:23
2018-11-13 (+0200) 14:33, this is an optional comment/note about something that was worth noting down
2018-11-13 (+0200) 15:04, time to take a break
pause->2018-11-13 (+0200) 15:14
2018-11-13 (+0200) 15:16, a couple of minutes ago, when I got back from the break, I inserted a new timestamp (above) to signal that the break is over.
pause 5min # look, I had a short break somewhere here, not important exactly when, but it was not work-related, so I noted it down like this
@motin
motin / commit-using-commitizen-in-new-iterm-window.scpt
Last active Oct 21, 2021
Add as SourceTree custom action: Open in Seperate Window (checked), Script to run `/path/to/commit-using-commitizen-in-new-iterm-window.sh` (this path MUST NOT contain spaces due to long-standing SourceTree bug https://jira.atlassian.com/browse/SRCTREE-2150), Parameters: `$REPO`
View commit-using-commitizen-in-new-iterm-window.scpt
on run argv
set repoPath to (item 1 of argv)
tell application "iTerm"
set newWindow to (create window with default profile)
tell current session of newWindow
write text "cd " & quoted form of repoPath & " && npx git-cz"
end tell
end tell
end run
@motin
motin / server.R
Created Sep 3, 2018 — forked from ncarchedi/server.R
Dynamically append arbitrary number of inputs (Shiny)
View server.R
library(shiny)
shinyServer(function(input, output) {
output$allInputs <- renderUI({
# Get value of button, which represents number of times pressed (i.e. number of inputs added)
inputsToShow <- input$appendInput
# Return if button not pressed yet
if(is.null(inputsToShow) || inputsToShow < 1) return()
# Initialize list of inputs
View background.js
/* global Study */
// All background/content scripts wraps their logic to wait for the study onAllowed event
// (listener needs to be setup before running Study.onWebExtensionLoad())
browser.study.onAllowed.addListener(async(variationName) => {
enableFeature(variationName);
});
// Will send the onAllow event if the study is allowed to run
Study.onWebExtensionLoad();
@motin
motin / Auth0ManagementApiClient.php
Created Dec 19, 2017
Example of client class to perform auth0 management api requests in php. AppJson.php is available here: https://gist.github.com/motin/dc3762a64c7daadaa724d674b3e1d5f3
View Auth0ManagementApiClient.php
<?php
/*
Example usage:
$this->auth0ManagementApiClient = new Auth0ManagementApiClient();
$accessToken = $this->auth0ManagementApiClient->ensureAccessToken();
if (!$accessToken) {
throw new Exception("Auth0 management access token empty");
}
@motin
motin / AppJson.php
Created Dec 19, 2017
Handle JSON decoding/encoding app-wide in a specific manner
View AppJson.php
<?php
/**
* Handle JSON decoding/encoding app-wide in a specific manner
*
* Class AppJson
*/
class AppJson
{