A Pen by Matt Daniel Brown on CodePen.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const url = 'https://api.example.com/v1/sse'; | |
const accessToken = 'test'; | |
fetch(url, { | |
headers: { | |
Authorization: `Bearer ${accessToken}`, | |
}, | |
}) | |
.then(response => { | |
if (response.ok && response.body) { | |
reader = response.body.pipeThrough(new TextDecoderStream()).getReader(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Cocoa | |
import Foundation | |
// Move around and click automatically at random places in macos, kinda human like in a cheap way. | |
// Moves the mouse pointer to `moves` random locations on the screen and runs the `action` function at | |
// each point with the point as argument. | |
func mouseMoveWithAction(moves: Int, action: (CGPoint) -> Void = defaultAction) { | |
let screenSize = NSScreen.main?.visibleFrame.size |
Some might be outdated.
Taken from (404 as of today): https://macosxautomation.com/system-prefs-links.html
$ open "x-apple.systempreferences:com.apple.preference.security?General"