Skip to content

Instantly share code, notes, and snippets.

@MaartenW
MaartenW / console-oneliner-nopromotweets.js
Created October 22, 2021 14:10
Obfuscate promoted tweets
setInterval(()=>{document.querySelectorAll('div[aria-label] > div > div > div > div[data-testid=placementTracking]').forEach((e)=>{e.style.opacity='0.2'})},1000);
@MaartenW
MaartenW / EnsoAX.m
Last active August 22, 2016 11:24
Check if MacOS app has assistive access and request if it hasn't
- (BOOL)assistiveEnabled{
NSDictionary *options = @{(__bridge id)kAXTrustedCheckOptionPrompt: @NO};
BOOL aen = AXIsProcessTrustedWithOptions((__bridge CFDictionaryRef)options);
return aen;
}
- (void)handleAssistiveAccess{
if (![self assistiveEnabled]) {
NSAlert *alert = [[NSAlert alloc] init];
[alert addButtonWithTitle:@"Open preference panel"];