Skip to content

Instantly share code, notes, and snippets.

View maxwellmlin's full-sized avatar

Maxwell Lin maxwellmlin

View GitHub Profile
@maxwellmlin
maxwellmlin / onetrust_id_mapping.js
Created July 27, 2023 20:22
OneTrust ID mapping
// Select all elements with an ID that starts with 'ot-header-id-'
onetrust_id_elements = document.querySelectorAll('*[id^="ot-header-id-"]');
success = true;
categories = {} // Map OneTrust ID to category name (e.g. 1: "Strictly Necessary Cookies")
onetrust_id_elements.forEach(function (element) {
let onetrust_id = element.id.split('ot-header-id-')[1]; // get the ID after the prefix
let category = element.innerText;
// Check for conflicts
@maxwellmlin
maxwellmlin / LPX-Trial-Reset.sh
Created April 14, 2021 03:46
Logic Pro X Trial Reset
mv -v ~/Library/Application\ Support/.lpxuserdata ~/.Trash
@iiLaurens
iiLaurens / code.js
Last active July 16, 2024 15:42
Get all clickable elements on a page
window.scrollTo(0, 0)
var bodyRect = document.body.getBoundingClientRect();
var items = Array.prototype.slice.call(
document.querySelectorAll('*')
).map(function(element) {
var rect=element.getBoundingClientRect();
return {
element: element,
include: (element.tagName === "BUTTON" || element.tagName === "A" || (element.onclick != null) || window.getComputedStyle(element).cursor == "pointer"),
@0xjac
0xjac / private_fork.md
Last active July 24, 2024 12:43
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare git@github.com:usi-systems/easytrace.git