Skip to content

Instantly share code, notes, and snippets.

@lancethomps
lancethomps / close_notifications_applescript.js
Last active April 8, 2024 07:43
AppleScript to close all notifications on macOS Big Sur, Monterey, and Ventura
function run(input, parameters) {
const appNames = [];
const skipAppNames = [];
const verbose = true;
const scriptName = "close_notifications_applescript";
const CLEAR_ALL_ACTION = "Clear All";
const CLEAR_ALL_ACTION_TOP = "Clear";
@lacostenycoder
lacostenycoder / README.md
Last active November 2, 2023 17:18
Ruby script to toggle night-mode hack on Slack Desktop app - Mac only, maybe linux

- IMPORTANT

For security, since this script injects CSS via AJAX, first fork the main slack night mode repo. The reason is explained here

UPDATE: The code has been modified to download the remote css to a local file and use ruby sass compiler to verify there is no malicious code in the remote css. This will error if the code has been modified to include anything malicious (i.e. script or img tags etc.) It's also been refactored to use the local file inside the js injection, it makes sure it's safe first in the very unlikely event the local file somehow differs from the remote css. The chances of this happening are remote, but this should suffice for safety.

Installation

  • save this script wherever you keep your ruby scripts for example ~/lacostenycoder/scripts/ruby/
  • change the URL in the remote_repo variable in ruby script to use YOUR repo. The rawgit.com file is crea
@thomasfr
thomasfr / autossh.service
Last active January 5, 2024 08:11
Systemd service for autossh
[Unit]
Description=Keeps a tunnel to 'remote.example.com' open
After=network.target
[Service]
User=autossh
# -p [PORT]
# -l [user]
# -M 0 --> no monitoring
# -N Just open the connection and do nothing (not interactive)