Skip to content

Instantly share code, notes, and snippets.

View motin's full-sized avatar

Motin motin

View GitHub Profile
df1 = pd.DataFrame([
{"url": "a", "Foo": '=C$2:C2', "bar": 'Cat'},
{"url": "b", "Foo": '=C$2:C3', "bar": 'Mouse'},
{"url": "c", "Foo": '=C$2:C2', "bar": 'Dog'},
{"url": "d", "Foo": '=C$2:C5', "bar": 'Eagle'},
{"url": "e", "Foo": 'C$2:C6', "bar": 'Albatross'},
{"url": "f", "Foo": '', "bar": 'Albatross'},
])
def df_add_col(df):
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 12:47
Running a fork of OpenWPM on your Mac

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 November 13, 2018 16:02
ttbwsd-simple-example-mobile.txt
S 1423
P 1504 1514
P 5
P 1723
@motin
motin / ttbwsd-simple-example-desktop.txt
Created November 13, 2018 15:23
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 November 13, 2018 15:25
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 January 10, 2023 18:57
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`
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 September 3, 2018 00:36 — forked from ncarchedi/server.R
Dynamically append arbitrary number of inputs (Shiny)
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
/* 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 December 19, 2017 14:51
Example of client class to perform auth0 management api requests in php. AppJson.php is available here: https://gist.github.com/motin/dc3762a64c7daadaa724d674b3e1d5f3
<?php
/*
Example usage:
$this->auth0ManagementApiClient = new Auth0ManagementApiClient();
$accessToken = $this->auth0ManagementApiClient->ensureAccessToken();
if (!$accessToken) {
throw new Exception("Auth0 management access token empty");
}