This file contains 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
# Copy the URL or tweet ID for a tweet, and the script will send it to Aaron's Twitter Viewer | |
set _old_delims to AppleScript's text item delimiters | |
set AppleScript's text item delimiters to "/" | |
set _tweet_url to get the clipboard | |
set _tweet_id to last text item of _tweet_url | |
try | |
get _tweet_id as integer | |
on error |
This file contains 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 is for anyone who still has the classic Mac OS era habit of using | |
Command-N to create a new folder in the Finder. It's intended for use with | |
Red Sweater Software's excellent FastScripts utility -- a replacement for the | |
system's build-in Scripts menu that allows for assigning keyboard shortcuts | |
to scripts, on a per-application basis. | |
FastScripts: https://red-sweater.com/fastscripts/ | |
Install the script here: ~/Library/Scripts/Applications/Finder/ |
This file contains 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/perl | |
# Description: http://daringfireball.net/2010/08/open_urls_in_safari_tabs | |
# License: See below. | |
# http://gist.github.com/507356 | |
use strict; | |
use warnings; | |
use URI::Escape; |
This file contains 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 | |
# Fork of CHOCK's original tot.sh to add support for dot "0" to target | |
# the first empty dot. | |
# https://gist.github.com/chockenberry/d33ef5b6e6da4a3e4aa9b07b093d3c23 | |
# | |
# 2 Mar 2020 | |
# + Incorporated suggestions from ShellCheck (https://www.shellcheck.net). | |
# Thanks to Ramsey Dow. | |
# + Changed call to `python` to `/usr/bin/python` to get Python 2, avoiding |
This file contains 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
tell application "BBEdit" | |
activate | |
set old_name to name of text window 1 | |
set dialog_result to display dialog "" default answer (old_name) ¬ | |
buttons {"Cancel", "Rename"} default button 2 ¬ | |
with icon note ¬ | |
with title "Rename Active Document" | |
if button returned of dialog_result = "Rename" then | |
set new_name to text returned of dialog_result | |
set d to active document of text window 1 |
This file contains 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
set _old_delims to AppleScript's text item delimiters | |
set AppleScript's text item delimiters to {""} | |
tell application "System Events" | |
set _current_app to name of the first process whose frontmost is true | |
end tell | |
tell application "Safari" | |
set _urls to {} | |
repeat with i from 1 to 6 -- how many Safari windows to show URLs from |
This file contains 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 | |
set imessage_id to "" -- leave blank to skip sending periodic iMessage progress updates, put your iMessage ID here to get updates as the script runs | |
set delay_seconds to 5 -- Don't set to 0, it runs too fast. 0.75 is a good setting for "go fast". | |
set computer_name to do shell script "scutil --get ComputerName" | |
set os_version to do shell script "sw_vers -productVersion" | |
set os_build to do shell script "sw_vers -buildVersion" | |
set _uptime to do shell script "uptime" | |
set url_list to {"http://techmeme.com", "http://www.consumerreports.org/laptops/macbook-pros-fail-to-earn-consumer-reports-recommendation/", "https://twitter.com/panzer/status/812367550734401536", "http://www.politico.com/story/2016/12/foreign-travelers-social-media-232930", "http://www.macworld.com/article/3153384/gaming/nintendo-plans-to-release-2-or-3-mobile-games-a-year-after-super-mario-runs-success.html", "http://www.wsj.com/articles/cyber-experts-cite-link-between-dnc-hacks-and-aggression-against-uk |
This file contains 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 ruby | |
def e_sh(str) | |
str.to_s.gsub(/(?=[^a-zA-Z0-9_.\/\-\x7F-\xFF\n])/n, '\\').gsub(/\n/, "'\n'").sub(/^$/, "''") | |
end | |
def find_headers(lines) | |
in_headers = false | |
lines.each_with_index {|line, i| | |
if line =~ /^\S[^\:]+\:( .*?)?$/ |
This file contains 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
tell application "Mail" | |
set _sel to get selection | |
if (count of _sel) > 1 then | |
-- multiple message selection, usually a conversation thread | |
choose from list {"Reply", "Reply All"} with prompt "Unknown recipient count." default items {"Reply"} | |
try | |
set _menu_command to item 1 of the result | |
on error | |
return |
This file contains 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
use strict; | |
use warnings; | |
use URI::Escape qw(uri_escape_utf8); | |
use open IO => ":utf8", # UTF8 by default | |
":std"; # Apply to STDIN/STDOUT/STDERR | |
my $query = do { local $/; <> }; | |
$query =~ s/^\s+//g; | |
$query =~ s/\s+$//g; |