Skip to content

Instantly share code, notes, and snippets.

View confluencepoint's full-sized avatar
🏳️
Focusing

confluencepoint confluencepoint

🏳️
Focusing
View GitHub Profile
@confluencepoint
confluencepoint / Get_front_Mac_App_URL--markdown.applescript
Created January 12, 2022 10:52 — forked from EvanLovely/Get_front_Mac_App_URL--markdown.applescript
Get Front Mac App Title and URL and make a Markdown Link to it
# Grab a URL from Chrome, Safari, Mail, Contacts, Finder, TextEdit, Omnifocus, Chrome Canary, or FoldingText
# Borrowed from: http://www.alfredforum.com/topic/917-reminders/?hl=reminders
tell application (path to frontmost application as text)
set theApplication to get name
end tell
set theText to ""
set theBody to ""
if theApplication is "Google Chrome" then
tell application id "com.google.chrome"
@confluencepoint
confluencepoint / appinfo.md
Created December 20, 2021 10:37 — forked from ttscoff/appinfo.md
appinfo: A quick ruby script for Mac that returns some information for a specified Mac app in Terminal. Includes icon display if using imgcat or chafa are available.

appinfo

A script for getting details of installed Mac apps. Like Get Info but faster and cooler.

Save the script below as appinfo somewhere in your path. Make it executable with chmod a+x appinfo. Then just run appinfo APPNAME to get info on any installed app.

function applicationWatcher(appName, eventType, appObject)
if (eventType == hs.application.watcher.launched) then
if (appName == "Music") then
appObject:kill()
end
end
end
appWatcher = hs.application.watcher.new(applicationWatcher)
appWatcher:start()
@confluencepoint
confluencepoint / init.lua
Created December 13, 2021 14:16 — forked from blalor/init.lua
Hammerspoon config for auto-typing passwords from the macOS Keychain
function password_from_keychain(service)
-- 'service' should be saved in the login keychain
local cmd = "/usr/bin/security 2>&1 >/dev/null find-generic-password -gs '" .. service .. "' | sed -En '/^password: / s,^password: \"(.*)\"$,\\1,p'"
local handle = io.popen(cmd)
local result = handle:read("*a")
handle:close()
return (result:gsub("^%s*(.-)%s*$", "%1"))
end
@confluencepoint
confluencepoint / init.lua
Last active December 13, 2021 13:59 — forked from amirrajan/init.lua
Full Hammerspoon File
require("hs.ipc")
function shell(command)
hs.execute(command .. ' &', true)
end
--- ==========================================
--- Terminal <> Browser ctrl+t
--- ==========================================
-- I spend all my time in chrome and terminal, ctrl+t swaps between the two
@confluencepoint
confluencepoint / mac-wipri.sh
Created December 8, 2021 13:19 — forked from mrpnelson/mac-wipri.sh
Mac WiFi Preferred Network Refresh Script
#!/bin/bash
# ------------------------------------------------------------------------------------------
# May 4, 2021 Update
# This is maintained here for reference, but it seems like the networksetup script
# is capable of doing this, at least in Big Sur. I haven't tested this on older versions.
# See https://gist.github.com/mrpnelson/c65302efed6c18300fb28c8da87bc69a#gistcomment-3731567
# for details on using the native tooling
# ------------------------------------------------------------------------------------------
@confluencepoint
confluencepoint / gist:4d47c587ab89309414fd9672e8c054f0
Created November 11, 2021 15:41 — forked from ctanis/gist:70a2ef077528e5a5c71f8d8473af3e5b
use hammerspoon to avoid triggering the menu bar, unless you hold alt
-- don't trigger menubar in fullscreen mode unless you hold alt
stopmenu=hs.eventtap.new({ hs.eventtap.event.types.mouseMoved }, function(e)
local flags=e:getFlags()
if not flags.alt then
if e:location().y<1 then
e:location().y=1
return e
end
end
return nil
@confluencepoint
confluencepoint / init.lua
Created October 24, 2021 10:46 — forked from RoyalIcing/init.lua
My Hammerspoon config
local math = require("hs.math")
currentSpeech = nil
mouseCircle = nil
mouseCircleTimer = nil
function mouseHighlight()
-- Delete an existing highlight if it exists
if mouseCircle then
@confluencepoint
confluencepoint / hammerspoon_config.lua
Created October 20, 2021 13:09 — forked from dropmeaword/hammerspoon_config.lua
My Hammerspoon configuration
-- Bring all Finder windows to front
function applicationWatcher(appName, eventType, appObject)
if (eventType == hs.application.watcher.activated) then
if (appName == "Finder") then
-- Bring all Finder windows forward when one gets activated
appObject:selectMenuItem({"Window", "Bring All to Front"})
end
end
end
local appWatcher = hs.application.watcher.new(applicationWatcher)
@confluencepoint
confluencepoint / QR-Code-Example
Created October 15, 2021 05:36 — forked from BPScott/QR-Code-Example
QR Code generation and instant preview from the command line
# Generating throwaway QR codes from the command line for shunting URLS to mobile devices
brew install qrencode
qrencode -o - http://www.google.com | open -f -a preview