Skip to content

Instantly share code, notes, and snippets.

@gruber
gruber / Split Tabs to New Window.scpt
Last active May 5, 2024 16:58
An AppleScript for Safari to move all tabs in the frontmost window, from the current tab to the rightmost (last) tab, to a new window.
use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions
(*
Original script: John Gruber (https://daringfireball.net/linked/2023/12/05/an-applescript-for-safari-split-tabs-to-new-window)
Much more elegant version: Leon Cowle (https://github.com/leoncowle)
Even more elegant version: https://stackoverflow.com/questions/54066100/applescript-to-split-safari-tabs-into-new-window/54089865#54089865
Worth a warning: "moving" tabs with this script doesn't actually move them like
drag-and-drop does. The tabs "moved" by this script will reload in the new window,
@shantur
shantur / MacPro-2013-GPU-Passthrough.txt
Last active June 2, 2024 12:59
MacPro 6,1 Late 2013 ESXi Ubuntu FirePro D700 / D500 passthough settings
ESXi Setup
1. Add to /etc/vmware/passthru.map
1002 6798 d3d0 default
1002 aaa0 d3d0 default
2. Run these commands
esxcli system settings kernel set -s vga -v FALSE
esxcli system settings kernel set -s iovDisableIR -v TRUE
@JonnyWong16
JonnyWong16 / plex_imdb_top_250_collection.py
Last active March 6, 2024 14:13
Automatically create an IMDB Top 250 collection in Plex using an existing movie library
# -*- coding: utf-8 -*-
#------------------------------------------------------------------------------
#
# Automated IMDB Top 250 Plex collection script by /u/SwiftPanda16
#
# *** Use at your own risk! ***
# *** I am not responsible for damages to your Plex server or libraries. ***
#
#------------------------------------------------------------------------------
@blacktwin
blacktwin / kill_trans_pause.py
Last active September 29, 2017 17:10
Kills Plex transcode stream if paused. Set in PlexPy to be triggered when a user pauses or run manually.
'''
kill_transcode function from https://gist.github.com/Hellowlol/ee47b6534410b1880e19
PlexPy > Settings > Notification Agents > Scripts > Bell icon:
[X] Notify on pause
PlexPy > Settings > Notification Agents > Scripts > Gear icon:
Playback Pause: kill_trans_pause.py
'''
@alirobe
alirobe / reclaimWindows10.ps1
Last active June 23, 2024 22:08
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
###
###
### UPDATE: For Win 11, I recommend using this tool in place of this script:
### https://christitus.com/windows-tool/
### https://github.com/ChrisTitusTech/winutil
### https://www.youtube.com/watch?v=6UQZ5oQg8XA
### iwr -useb https://christitus.com/win | iex
###
###
set deviceID to (do shell script "diskutil list | awk '/YourBootcampPartition/ {print $NF}'")
do shell script "sudo bless -device /dev/" & deviceID & " -legacy -setBoot -nextonly"
tell application "Finder" to restart
@neophit
neophit / Useful Keyboard Text Shortcuts.applescript
Last active July 7, 2019 12:01
Add useful keyboard text shortcuts for exponents and fractions to your System Preferences. With iCloud enabled, these shortcuts will sync with your iOS devices. Tested on OS X 10.9.1 and iOS 7.0.4. Requires GUI Scripting Access: http://support.apple.com/kb/HT5914 (Based partially on this script: https://gist.github.com/Zettt/7724258)
set clickDelay to 0.3
set textReplaceList to {}
set exponentsListName to "Exponents (replaces ^0-^9 with ⁰-⁹)"
set fractionsListName to "Fractions (replaces 1/2-7/8 with ½-⅞)"
set exponentsList to {{"^0", "⁰"}, {"^1", "¹"}, {"^2", "²"}, {"^3", "³"}, {"^4", "⁴"}, {"^5", "⁵"}, {"^6", "⁶"}, {"^7", "⁷"}, {"^8", "⁸"}, {"^9", "⁹"}}
set fractionsList to {{"1/2", "½"}, {"1/3", "⅓"}, {"1/4", "¼"}, {"1/5", "⅕"}, {"1/6", "⅙"}, {"1/7", "⅐"}, {"1/8", "⅛"}, {"1/9", "⅑"}, {"1/10", "⅒"}, {"2/3", "⅔"}, {"2/5", "⅖"}, {"3/4", "¾"}, {"3/5", "⅗"}, {"3/8", "⅜"}, {"4/5", "⅘"}, {"5/6", "⅚"}, {"5/8", "⅝"}, {"7/8", "⅞"}}
set chosenLists to (choose from list {exponentsListName, fractionsListName} with title "Useful Keyboard Text Shortcuts" with prompt "Choose one or more sets of keyboard text shortcuts to add to your System Preferences.
This may take a minute to complete." OK button name "Add text shortcuts" cancel button name "Cancel" default items {exponentsListName, fractionsListName} with multiple selections allowed)
@benspaulding
benspaulding / ReadMe.rst
Created October 17, 2011 01:24
Scripts for using BBEdit, TextWrangler, or MacVim as default command line EDITOR.

EDITOR Helpers

Author: Ben Spaulding

This is a collection of helper scripts for using popular Mac text editors as your terminal EDITOR.

These are certainly not essential, as all of the editors helped here ship with a powerful command-line utility. However, to properly use them for something like