This file contains hidden or 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
#! /usr/bin/env bash | |
set -e -u -o pipefail | |
#Usage | |
usage="Usage: ./generate_json.sh [options] <edn_config_file> <rule_title>" | |
show_help() { | |
cat << EOF | |
$usage |
This file contains hidden or 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
{:layers {:homerow {:key :caps_lock :alone {:key :escape}} | |
:symbols {:key :tab}} | |
:main [{:des "multitouch" | |
:rules [:multitouch_extension_finger_count_total | |
[:spacebar :button1] | |
[:f :button1] | |
[:d :button2] | |
[:s :button3] | |
[:z [:button1 :!Cz]] |
This file contains hidden or 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
-- This script uses Acorn (tested with version 6.6.4) | |
-- to add a light border around a window screenshot. | |
-- | |
-- Screenshots (without the huge macOS shadows) are made by shift-cmd-4, then space bar, | |
-- then option-click on window (see https://apple.stackexchange.com/a/120017/17533) | |
-- | |
-- Before use, you need to create a Preset Filter for this, once: | |
-- With an image opened, use from menu: Filter / Stylize / Drop Shadow… | |
-- Set its options as you prefer (e.g. X/Y offset 0, Blur Radius 2, Opacity 80%), | |
-- then save it by clicking the gear icon, choose "Save Filter Preset…" and |
This file contains hidden or 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
{ | |
;; :!Ca is keycode :a and prefix a with !C | |
;; C | left_command | |
;; T | left_control | |
;; O | left_option | |
;; S | left_shift | |
;; F | fn | |
;; Q | right_command | |
;; W | right_control |
This file contains hidden or 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
function saveWindowsLayout(args) | |
local layout = {} | |
for _, w in pairs(hs.window.allWindows()) do | |
layout[tostring(w:id())] = { | |
frame = w:frame().table, | |
title = w:title(), | |
} | |
end | |
hs.settings.set("zWindowsLayout", hs.json.encode(layout)) | |
end |
This file contains hidden or 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
#!/bin/bash | |
# Usage: | |
# | |
# 1. Create a `apple-news` file somewhere in your $PATH with the content of this file | |
# 2. That’s it! You can now use the `apple-news` utility: | |
# | |
# ``` | |
# $ apple-news https://apple.news/AKoDCWtVEQP2w7Ld657lgIg | |
# https://www.theguardian.com/technology/2022/mar/30/dyson-launches-zone-air-purifying-bluetooth-headphones-with-visor |
This file contains hidden or 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
local qStartTime = 0.0 | |
local qDuration = 1.5 | |
hs.hotkey.bind({"cmd"}, "Q", function() | |
qStartTime = hs.timer.secondsSinceEpoch() | |
end, function() | |
local qEndTime = hs.timer.secondsSinceEpoch() | |
local duration = qEndTime - qStartTime | |
if duration >= qDuration then hs.application.frontmostApplication():kill() end | |
end) |
This file contains hidden or 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
on run argv | |
-- Variables | |
set _cmd to (item 1 of argv) | |
tell application "Finder" to set _bounds to bounds of window of desktop | |
set _xPos to (item 1 of _bounds) | |
set _yPos to (item 2 of _bounds) | |
set _ySize to (item 3 of _bounds) | |
set _xSize to (item 4 of _bounds) | |
-- get bounds | |
-- do split: app1, app2, set split |
This file contains hidden or 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
-- Delete all from sender - https://gist.github.com/xunker/44fa4404c882c27e0ad25857e9470552 | |
-- For the Mail.app in Mac OS X. It will search for all messages set by the sender of the email message currently open, | |
-- highlight them all and ask if you want to delete them. If you choose "yes" it will delete them for you and then clear | |
-- the search. | |
-- | |
-- Important notes: | |
-- You can load this in Script Editor and then save it as an application so you can run it without Script Editor being open. | |
-- This does not work when Mail.app is in fullscreen mode; it must be in windowed mode. | |
-- You will need to enable "Assistive Devices" support for Script Editor (if run there) or for the .app you saved if you converted it to a standalone app. |