Skip to content

Instantly share code, notes, and snippets.

@somebox
somebox / ricardo-learning.md
Last active March 10, 2018 10:45
Learning Resources
@clickysteve
clickysteve / init.lua
Last active December 9, 2022 08:18 — forked from prenagha/init.lua
Hammerspoon config file for getting Hyper Key (Caps) to work on Sierra
-- My own config file to get the Hyper Key working again with my current setup.
-- All credit goes to @prenagha and @ttscoff for their awesome original code that I tweaked for my own devices.
-- Credit 1: https://gist.github.com/ttscoff/cce98a711b5476166792d5e6f1ac5907
-- Credit 2: https://gist.github.com/prenagha/1c28f71cb4d52b3133a4bff1b3849c3e
-- A global variable for the sub-key Hyper Mode
k = hs.hotkey.modal.new({}, 'F17')
-- Hyper-key for all the below are setup somewhere... Usually Keyboard Maestro or similar. Alfred doesn't handle them very well, so will set up separate bindings for individual apps below.
@benwaldie
benwaldie / saveSelectedMailAttachments.applescript
Created October 27, 2016 19:03
Save Selected Mail Message Attachments
set theSavePath to path to desktop folder as string
tell application "Mail"
selection
set theMessage to item 1 of result
set theAttachments to every mail attachment of theMessage
repeat with anAttachment in theAttachments
set theName to name of anAttachment
save anAttachment in file (theSavePath & theName)
end repeat
end tell
@mitcdh
mitcdh / Set Name to kMDItemTitle.applescript
Last active April 3, 2017 00:42
Devonthink script to set the name of any selected records to their kMDItemTitle metadata property
tell application id "DNtp"
try
set this_selection to the selection
set this_count to count of this_selection
if this_count > 0 then
show progress indicator "Renaming" steps this_count
repeat with this_item in this_selection
set this_metadata to meta data of this_item
try
set this_title to |kMDItemTitle| of this_metadata
{
"NSServicesExplicitDirectoryCache" => {
"/Library/Services/" => [
]
"/AppleInternal/Library/Services/" => [
]
"/Network/Library/Services/" => [
]
"/System/Library/Services/" => [
0 => "/System/Library/Services/Add to iTunes as a Spoken Track.workflow"
@scriptingosx
scriptingosx / ssh-installer.sh
Created October 17, 2016 12:25
ssh-installer tool for macOS to `scp` a package to a remote host and install it
#!/bin/sh
PATH=/usr/bin:/bin:/usr/sbin:/sbin export PATH
# ssh-installer
# copies a pkg with scp and runs installer on target
# usage: ssh-installer [USER@]HOST PKGFILE [other installer options]
TMPPKGDIR="/private/tmp/ssh-installer/"
@lgw4
lgw4 / ssh-add-keys.sh
Last active March 31, 2019 18:42
Add SSH Keys to macOS Keychain
#!/usr/bin/env bash
# Add DSA keys
for dsa in ${HOME}/.ssh/*_dsa; do
/usr/bin/ssh-add -K "${dsa}"
done
# Add RSA keys
for rsa in ${HOME}/.ssh/*_rsa; do
/usr/bin/ssh-add -K "${rsa}"
@kloudsamurai
kloudsamurai / java_homebrew.sh
Last active September 10, 2021 13:53
Install Java via Homebrew (brew) on Mac OSX with unlimited strength JCE
brew update
brew cask install java
brew cask install jce-unlimited-strength-policy
export JAVA_HOME=`/usr/libexec/java_home -v 1.8`
set _Path to "<<enter path to your script folder here>>"
set scriptLaunch to text returned of (display dialog "Enter name of script to run" default answer "" buttons "OK" default button "OK")
if scriptLaunch contains "" then
error number -128
else if scriptLaunch contains scriptLaunch then
try
set scriptRun to _Path & "/" & scriptLaunch & ".scpt"
run script scriptRun
on error
display alert "Your script failed to launch."
@pavelbinar
pavelbinar / extract-subtitles-from-mkv.md
Last active October 29, 2025 21:23 — forked from bmaeser/subtitle-extract.txt
Extract subtitles from .mkv files on Mac OS X