Posts

Showing posts from March, 2025

Copy to clipboard button for Google Drive files

A better file viewer than the one Google provides, that's more suitable for displaying code and text files, with a Copy to clipboard button as well — great when using mobile devices that only offer Select All functionality for editable text. Go to Apps Script in your Google account Click New project in the upper left corner In the code editor, replace everything with the following: function doGet(e) { const id = "FILE_ID"; const file = DriveApp.getFileById(id); const contents = file.getBlob().setContentType("text/plain").getDataAsString(); const html = `<!DOCTYPE html> <html> <head> <base target="_top"> <style> :root { color-scheme: light dark; } pre { overflow-wrap: break-word; white-space: pre-wrap; } </style> </head> <body> <button id="copy">Copy to clipboar...

Always, 100% of the time, open tabs to the right of the current tab in Safari for macOS

Here's how you can fix the chronic pain in the neck New Tab behaviour in Safari for macOS, where there's no way at all for users to decide the position their new tabs should open at. For new blank tabs Download Keyboard Cowboy [open source] Install and launch it Once opened, in the leftmost panel… Under Configuration , leave it at Default Configuration Under Groups , click the barely visible Add Group button In the window that opens, set the name to Safari , then in the Application drop-down menu, select Safari, and finally click Save Make sure the Safari group is selected In the middle panel… Under Workflows , click the barely visible Add Workflow button In the rightmost panel… Set the workflow name to e.g. New tab Under Add Trigger , click the Keyboard Shortcut button Use command-T as the keyboard shortcut Click the New Command button and then in the popup menu, select Scripting and then New AppleScript ...

Run Python code in Shortcuts app without relying on apps or APIs

Simple shortcut that let's you enter some Python code, then executes the code and displays the output. Makes use of the Pyodide JavaScript library. This means you need an internet connection the first time you run it, but since the library is cached (not sure for how long), it's possible to use offline too. Installing packages with micropip or loadPackage currently doesn't work due to some unidentified bug or limitation in Shortcuts app. Download the shortcut here .

Deep-links to almost every Safari setting on iOS

More than 50 prefs: URLs to most of the subpages, buttons, switches and sections in the Safari settings pages on iOS. A few of them only works on specific devices. The URLs were mostly found by examining iOS system files and the rest through guesswork or trial and error. Click the titles to display the URL Allow Safari to access → Siri (page) prefs:root=SAFARI&path=SIRI Allow Safari to access → Search (page) prefs:root=SAFARI&path=SEARCH Default Browser App (page) N/A Preferred Language → Language (page) prefs:root=SAFARI&path=PREFERRED_LANGUAGE Search → Search Engine (page) prefs:root=SAFARI&path=SEARCH_ENGINE_SETTING Search → Also Use in Private Browsing (switch) N/A Search → Search Engine Suggestions (switch) prefs:root=SAFARI#SEARCH_SUGGESTION_SETTING Search → Safari Suggestions (switch) prefs:root=SAFARI#SIRI_SUGGESTIONS Search → Quick Website Search (page) prefs:root=SAFARI&path=SITE_SPECIFIC...