<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>groupInfo</key>
	<dict>
		<key>expandAfterMode</key>
		<integer>2</integer>
		<key>groupName</key>
		<string>Brett's Tools</string>
		<key>notes</key>
		<string>Misc text, HTML, Markdown and URL tools
</string>
	</dict>
	<key>snippetsTE2</key>
	<array>
		<dict>
			<key>abbreviation</key>
			<string>kbd</string>
			<key>abbreviationMode</key>
			<integer>0</integer>
			<key>creationDate</key>
			<date>2022-09-15T05:03:00Z</date>
			<key>label</key>
			<string>Keyboard Shortcut Symbols</string>
			<key>modificationDate</key>
			<date>2022-09-15T05:03:00Z</date>
			<key>plainText</key>
			<string>#!/bin/bash
# Converts "cmd shift d" or "@$d" to "⇧+⌘+D"
# Uses &lt;https://github.com/kotfu/ksc&gt; which requires manual install. Save the script to /usr/local/bin/ksc (or modifiy the path below)
INPUT='%fill:Key Combination%'
PLUS=""

# add -p to include plus signs
printf '%s' $(/usr/local/bin/ksc -ms$PLUS "$INPUT")
</string>
			<key>snippetType</key>
			<integer>3</integer>
			<key>uuidString</key>
			<string>E6C2629D-58FD-4B5A-9B57-28DB21C30931</string>
		</dict>
		<dict>
			<key>abbreviation</key>
			<string>kbdt</string>
			<key>abbreviationMode</key>
			<integer>0</integer>
			<key>creationDate</key>
			<date>2022-09-15T05:03:00Z</date>
			<key>label</key>
			<string>Keyboard Shortcut Text</string>
			<key>modificationDate</key>
			<date>2022-09-15T05:03:00Z</date>
			<key>plainText</key>
			<string>#!/bin/bash
# Converts "cmd shift d" or "@$d" to "Shift-Command-D"
# Uses &lt;https://github.com/kotfu/ksc&gt; which requires manual install. Save the script to /usr/local/bin/ksc (or modifiy the path below)
INPUT='%fill:Key Combination%'

printf '%s' $(/usr/local/bin/ksc -k -c "$INPUT")
</string>
			<key>snippetType</key>
			<integer>3</integer>
			<key>uuidString</key>
			<string>0CE1366B-4282-45E7-8796-41B2F53562D5</string>
		</dict>
		<dict>
			<key>abbreviation</key>
			<string>mad</string>
			<key>abbreviationMode</key>
			<integer>0</integer>
			<key>creationDate</key>
			<date>2022-09-15T05:03:00Z</date>
			<key>label</key>
			<string>Make a Date 2</string>
			<key>modificationDate</key>
			<date>2022-09-15T05:03:00Z</date>
			<key>plainText</key>
			<string>#!/usr/bin/ruby

datestring="%filltext:name=Date String:default=now%"
format="%fillpopup:name=Format:default=iso:short:long:slashed%"

### Convert Date action
### Copyright 2021 Brett Terpstra &lt;https://brettterpstra.com&gt;
### Freely distribute and edit, but please maintain attribution
require 'Time'

class DateUtils

  def initialize(time_zone = 'America/Chicago')
    @time_zone = time_zone
  end

  def parsedate(date,format,unpad=false)
    date = Time.parse(%x{php -r "date_default_timezone_set('#{@time_zone}');echo strftime('%c',strtotime('#{date}'));"})
    parsed = date.strftime(format).gsub(/%o/,"#{ordinal(date.strftime('%e').to_i)}")
    parsed.gsub!(/(^|-|\/|\s)0/,"\\1") if unpad
    # if there's no space between time and meridiem, downcase it
    parsed.gsub!(/(\d)(AM|PM)/) {|m| $1 + $2.downcase }
    return parsed =~ /1969/ ? false : parsed
  end

  # Returns an ordinal number. 13 -&gt; 13th, 21 -&gt; 21st etc.
  def ordinal(number)
    if (11..13).include?(number.to_i % 100)
      "#{number}th"
    else
      case number.to_i % 10
      when 1; "#{number}st"
      when 2; "#{number}nd"
      when 3; "#{number}rd"
      else    "#{number}th"
      end
    end
  end

  def timeize(time_string,format)
    # Uses standard strftime format, but %0I will pad single-digit hours
    if time_string =~ /(\d{1,2})(?::(\d\d))?(?:\s*(a|p)m?)?/i
      hour = $1.to_i
      minute = $2.nil? ? "00" : $2.to_i
      meridiem = $3
      meridiem = hour &gt; 12 ? "p" : "a" if meridiem.nil?
      format.gsub!(/%H/) {|m|
        hour = hour &lt; 12 &amp;&amp; meridiem == "p" ? hour + 12 : hour
        hour = 0 if hour == 12 &amp;&amp; meridiem == "a"
        hour &lt; 10 ? "0" + hour.to_s : hour
      }
      format.gsub!(/%(0)?I/) {|m|
        hour = hour &gt; 12 ? hour - 12 : hour
        $1 == "0" &amp;&amp; hour &lt; 10 ? "0" + hour.to_s : hour
      }
      format.gsub!(/%M/, '%02d' % minute.to_i)
      format.gsub!(/%p/,meridiem.downcase + "m")
      format.gsub!(/%P/,meridiem.upcase + "M")
    end
    format
  end
end

original = format + " " + datestring

# split input and handle thursday@3 format
input = original.gsub(/(\S)@(\S)/,"\\1 at \\2").split(" ")
unpad = true
du = DateUtils.new

# %%o is replaced with ordinal day
format =  case input[0]
          when 'date' then '%m/%d/%y' # slashed date
          when 'local' then '%F' # localized date
          when 'short' then '%a, %b %%o, %Y' # abbreviated full date
          when 'long' then '%A, %B %%o, %Y' # long full date
          when 'iso' then '%Y-%m-%d'
          else false
          end

# turn off leading zero removal for certain types
unpad = false if input[0] =~ /(date|local|iso)/

# handle +# to advance # days
input.map! {|part|
  part.gsub(/^\+(\d+)$/,"\\1 days").gsub(/^at$/,'')
}

# time formatting
time_format = ""
time_string = ""
if datestring.strip =~ /^now$/
  time_string = Time.now.strftime('%H:%M')
elsif original.gsub(/\+\d+/,'') =~ /(?mi)((?:at|@) *(\d{1,2}(?::\d\d)?(?:am|pm)?)|(\d{1,2}(?::\d\d)?(?:am|pm))|(\d{1,2}:\d\d))/
  m = Regexp.last_match
  time_string = if m[2]
                  m[2]
                elsif m[3]
                  m[3]
                elsif m[4]
                  m[4]
                end

  time_format = case input[0]
                when 'iso' then du.timeize(time_string, ' %H:%M')
                when 'long' then du.timeize(time_string, ' at %I:%M%p')
                else du.timeize(time_string, ' %I:%M %P')
                end

  # input.delete_if { |item|
  #   item =~ /^(@|at|@?\d{1,2}(:\d\d)?((a|p)m?)?|((a|p)m?))$/i
  # }
end

date_string = ""
if format
  if input.length &gt; 1
    if original.sub(/((@|at)\s*)?#{time_string}/,'') =~ /^\s*$/m || original.strip =~ /^now$/
      date_string = "today #{time_format}"
    else
      date_string = input[1..input.length].delete_if(&amp;:empty?).join(" ")
    end
  else
    date_string = "today"
  end
else
  if original.gsub(/((@|at)\s*)?#{time_string}/,'') =~ /^\s*$/m
	date_string = "today #{time_format}"
  else
    date_string = input.join(" ")
  end
  unpad = false
  format = '%F'
end

output = du.parsedate(date_string, format + time_format, unpad)

if output
  print output
else
  print original
end
</string>
			<key>snippetType</key>
			<integer>3</integer>
			<key>uuidString</key>
			<string>C1D20A47-F2BB-4D40-90DE-F0F450088419</string>
		</dict>
		<dict>
			<key>abbreviation</key>
			<string>@d</string>
			<key>abbreviationMode</key>
			<integer>0</integer>
			<key>creationDate</key>
			<date>2022-09-15T05:03:00Z</date>
			<key>label</key>
			<string>@done</string>
			<key>modificationDate</key>
			<date>2022-09-15T05:03:00Z</date>
			<key>plainText</key>
			<string>@done(%Y-%m-%d %H:%M)</string>
			<key>snippetType</key>
			<integer>0</integer>
			<key>uuidString</key>
			<string>0AF95809-7F70-46D5-96AC-06212C317A96</string>
		</dict>
		<dict>
			<key>abbreviation</key>
			<string>url</string>
			<key>abbreviationMode</key>
			<integer>0</integer>
			<key>creationDate</key>
			<date>2022-09-15T05:03:00Z</date>
			<key>label</key>
			<string>Make URL</string>
			<key>modificationDate</key>
			<date>2022-09-15T05:03:00Z</date>
			<key>plainText</key>
			<string>#!/usr/bin/env ruby

def entity_escape(text)
  text.gsub(/&amp;(?!([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+);)/, '&amp;amp;')
end

def make_link(text)
  case text
  when %r{\A(mailto:)?(.*?@.*\..*)\z}
    "mailto:#{$2.gsub(/./) {sprintf("&amp;#x%02X;", $&amp;.unpack("U")[0])}}"
  when %r{\Ahttps?://.*?\.\w{2,4}.*?\z}
    entity_escape(text)
  when %r{\A(www\..*|.*\.\w{2,4})\z}
    "https://#{entity_escape(text)}"
  when %r{\A.*?\.\w{2,4}\/?.*\z}
    "https://#{entity_escape(text)}"
  when %r{^@\w+$}
    "https://twitter.com/#{text.sub(/^@/, '')}"
  else
    nil
  end
end

url = make_link %x{__CF_USER_TEXT_ENCODING=$UID:0x8000100:0x8000100 pbpaste}.strip
print url unless url.nil?
</string>
			<key>snippetType</key>
			<integer>3</integer>
			<key>uuidString</key>
			<string>0B63C1FD-BC34-410D-818A-C41997336A7E</string>
		</dict>
		<dict>
			<key>abbreviation</key>
			<string>swear</string>
			<key>abbreviationMode</key>
			<integer>0</integer>
			<key>creationDate</key>
			<date>2022-09-15T05:03:00Z</date>
			<key>label</key>
			<string>Censor swear word</string>
			<key>modificationDate</key>
			<date>2022-09-15T05:03:00Z</date>
			<key>plainText</key>
			<string>// add a new snippet and set it to Content: JavaScript
// paste this code
// set the abbreviation to the word you want censored when typed

function censor (input) {
	var badWord = input.replace(/((er)?s?|ing)?$/, '');
	return input.replace(badWord, censored(badWord));
}

function shuffleArray(inputArr) {
	var array = inputArr.slice(0);
    for (var i = array.length - 1; i &gt; 0; i--) {
        var j = Math.floor(Math.random() * (i + 1));
        var temp = array[i];
        array[i] = array[j];
        array[j] = temp;
    }
    return array;
}

function censored (word) {
	var chars = '#@!$%*&amp;^¡ø'.split(''),
		output = word.substr(0,1);

	while (output.length &lt; word.length - 1) {
		output += shuffleArray(chars).join('');
	}
	return output.substr(0,word.length).replace('$&amp;', '$$$&amp;');
}

TextExpander.appendOutput(censor('%filltext:name=word%'));


%filltop%</string>
			<key>snippetType</key>
			<integer>4</integer>
			<key>uuidString</key>
			<string>6D2A0468-E696-4063-B55E-F0EF2A05B557</string>
		</dict>
		<dict>
			<key>abbreviation</key>
			<string>sut</string>
			<key>abbreviationMode</key>
			<integer>0</integer>
			<key>creationDate</key>
			<date>2022-09-15T05:03:00Z</date>
			<key>label</key>
			<string>Shorten clipboard (tinyurl)</string>
			<key>modificationDate</key>
			<date>2022-09-15T05:03:00Z</date>
			<key>plainText</key>
			<string>#!/usr/bin/ruby
# tinyurl shortener TextExpander Snippet by Brett Terpstra
# Working as of Feb, 2021 but APIs are a'changin

require 'open-uri'
require 'cgi'

def entity_escape(text)
  text.gsub(/&amp;(?!([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+);)/, '&amp;amp;')
end

def make_link(text)
  case text
  when %r{\Ahttps?://.*?\.\w{2,4}.*?\z}
    entity_escape(text)
  when %r{\A(www\..*|.*\.\w{2,4})\z}
    "http://#{entity_escape text}"
  when %r{\A.*?\.\w{2,4}\/?.*\z}
    "http://#{entity_escape text}"
  else
    nil
  end
end

url = make_link %x{__CF_USER_TEXT_ENCODING=$UID:0x8000100:0x8000100 pbpaste}.strip

print open("http://tinyurl.com/api-create.php?url=#{CGI.escape(url)}").read.strip unless url.nil?</string>
			<key>snippetType</key>
			<integer>3</integer>
			<key>uuidString</key>
			<string>FA4F2B08-0D3C-4BE9-9B25-A6F403AACFFF</string>
		</dict>
		<dict>
			<key>abbreviation</key>
			<string>surl</string>
			<key>abbreviationMode</key>
			<integer>0</integer>
			<key>creationDate</key>
			<date>2022-09-15T05:03:00Z</date>
			<key>label</key>
			<string>Current Safari url</string>
			<key>modificationDate</key>
			<date>2022-09-15T05:03:00Z</date>
			<key>plainText</key>
			<string>tell application "Safari" to return URL of current tab of window 1</string>
			<key>snippetType</key>
			<integer>2</integer>
			<key>uuidString</key>
			<string>127E7191-FC0C-4EA3-B580-F6469A0C8F1A</string>
		</dict>
		<dict>
			<key>abbreviation</key>
			<string>surb</string>
			<key>abbreviationMode</key>
			<integer>0</integer>
			<key>creationDate</key>
			<date>2022-09-15T05:03:00Z</date>
			<key>label</key>
			<string>Shorten current Safari tab</string>
			<key>modificationDate</key>
			<date>2022-09-15T05:03:00Z</date>
			<key>plainText</key>
			<string>#!/usr/bin/ruby
# Bit.ly shortener TextExpander Snippet by Brett Terpstra
# Working as of June, 2012 but APIs are a'changin
# Create snippets for username (shortcut: #btlyu) and API key (shortcut: #btlya)
# Find your API key at http://bit.ly/a/your_api_key

require 'open-uri'
require 'cgi'

def entity_escape(text)
  text.gsub(/&amp;(?!([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+);)/, '&amp;amp;')
end

def make_link(text)
  case text
  when %r{\Ahttps?://.*?\.\w{2,4}.*?\z}
    entity_escape(text)
  when %r{\A(www\..*|.*\.\w{2,4})\z}
    "http://#{entity_escape text}"
  when %r{\A.*?\.\w{2,4}\/?.*\z}
    "http://#{entity_escape text}"
  else
    nil
  end
end

def get_chrome_url
  %x{osascript -e 'tell application "Safari" to return URL of current tab of window 1'}.strip
end

USER_NAME = '%snippet:#btlyu%' # Your login name
API_KEY = '%snippet:#btlya%' 

url = get_chrome_url

res = open("https://api-ssl.bit.ly/v3/shorten?login=#{USER_NAME}&amp;apiKey=#{API_KEY}&amp;longUrl=#{CGI.escape(url)}&amp;format=txt").read unless url.nil?

begin
  print res.strip unless res.nil?
rescue
  exit
end</string>
			<key>snippetType</key>
			<integer>3</integer>
			<key>uuidString</key>
			<string>9426C0C7-02D5-4F6B-92EC-B91D56B2F64C</string>
		</dict>
		<dict>
			<key>abbreviation</key>
			<string>sui</string>
			<key>abbreviationMode</key>
			<integer>0</integer>
			<key>creationDate</key>
			<date>2022-09-15T05:03:00Z</date>
			<key>label</key>
			<string>Shorten clipboard (is.gd)</string>
			<key>modificationDate</key>
			<date>2022-09-15T05:03:00Z</date>
			<key>plainText</key>
			<string>#!/usr/bin/ruby
# is.gd shortener TextExpander Snippet by Brett Terpstra
# Working as of Feb, 2021 but APIs are a'changin

require 'open-uri'
require 'cgi'

def entity_escape(text)
  text.gsub(/&amp;(?!([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+);)/, '&amp;amp;')
end

def make_link(text)
  case text
  when %r{\Ahttps?://.*?\.\w{2,4}.*?\z}
    entity_escape(text)
  when %r{\A(www\..*|.*\.\w{2,4})\z}
    "http://#{entity_escape text}"
  when %r{\A.*?\.\w{2,4}\/?.*\z}
    "http://#{entity_escape text}"
  else
    nil
  end
end

url = make_link %x{__CF_USER_TEXT_ENCODING=$UID:0x8000100:0x8000100 pbpaste}.strip
print open("http://is.gd/api.php?longurl=#{CGI.escape(url)}").read.strip unless url.nil?</string>
			<key>snippetType</key>
			<integer>3</integer>
			<key>uuidString</key>
			<string>3F606B8B-1F45-4663-906C-F2DFE7D592E3</string>
		</dict>
		<dict>
			<key>abbreviation</key>
			<string>sub</string>
			<key>abbreviationMode</key>
			<integer>0</integer>
			<key>creationDate</key>
			<date>2022-09-15T05:03:00Z</date>
			<key>label</key>
			<string>Shorten clipboard (bit.ly)</string>
			<key>modificationDate</key>
			<date>2022-09-15T05:03:00Z</date>
			<key>plainText</key>
			<string>#!/usr/bin/ruby
# Bit.ly shortener TextExpander Snippet by Brett Terpstra
# Working as of June, 2012 but APIs are a'changin
# Create snippets for username (shortcut: #btlyu) and API key (shortcut: #btlya)
# Find your API key at http://bit.ly/a/your_api_key

require 'open-uri'
require 'cgi'

def entity_escape(text)
  text.gsub(/&amp;(?!([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+);)/, '&amp;amp;')
end

def make_link(text)
  case text
  when %r{\Ahttps?://.*?\.\w{2,4}.*?\z}
    entity_escape(text)
  when %r{\A(www\..*|.*\.\w{2,4})\z}
    "http://#{entity_escape text}"
  when %r{\A.*?\.\w{2,4}\/?.*\z}
    "http://#{entity_escape text}"
  else
    nil
  end
end

USER_NAME = '%snippet:#btlyu%'
API_KEY = '%snippet:#btlya%'

url = make_link %x{__CF_USER_TEXT_ENCODING=$UID:0x8000100:0x8000100 pbpaste}.strip
bitly_url = "https://api-ssl.bit.ly/v3/shorten?login=#{USER_NAME}&amp;apiKey=#{API_KEY}&amp;longUrl=#{CGI.escape(url)}&amp;format=txt"

res = open(bitly_url).read unless url.nil?

begin
  print res.strip unless res.nil?
rescue
  exit
end
</string>
			<key>snippetType</key>
			<integer>3</integer>
			<key>uuidString</key>
			<string>534FFB95-D17D-488F-B3E9-392757F102C6</string>
		</dict>
		<dict>
			<key>abbreviation</key>
			<string>mt</string>
			<key>abbreviationMode</key>
			<integer>0</integer>
			<key>creationDate</key>
			<date>2022-09-15T05:03:00Z</date>
			<key>label</key>
			<string>Obfuscate Mailto</string>
			<key>modificationDate</key>
			<date>2022-09-15T05:03:00Z</date>
			<key>plainText</key>
			<string>#!/usr/bin/env ruby

email = "%fill:Email Address%"
linktext = "%fill:Link Text%"
subject = "%filltext:name=Subject%"

email = 'mailto:' + email
email += "?subject=#{subject}" if subject.length &gt; 0

print %(&lt;a href="javascript:location='#{email.unpack('U*').map{ |i| "\\u" + i.to_s(16).rjust(4, '0') }.join}';void 0"&gt;#{linktext}&lt;/a&gt;)</string>
			<key>snippetType</key>
			<integer>3</integer>
			<key>uuidString</key>
			<string>460A3C31-826A-4122-B4CF-D2F4A46D73F1</string>
		</dict>
		<dict>
			<key>abbreviation</key>
			<string>mlink</string>
			<key>abbreviationMode</key>
			<integer>0</integer>
			<key>creationDate</key>
			<date>2022-09-15T05:03:00Z</date>
			<key>label</key>
			<string>Markdown Link</string>
			<key>modificationDate</key>
			<date>2022-09-15T05:03:00Z</date>
			<key>plainText</key>
			<string>#!/usr/bin/env ruby

def entity_escape(text)
  text.gsub(/&amp;(?!([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+);)/, '&amp;amp;')
end

def make_link(text)
  case text
  when %r{\A(mailto:)?(.*?@.*\..*)\z}
    "mailto:#{$2.gsub(/./) {sprintf("&amp;#x%02X;", $&amp;.unpack("U")[0])}}"
  when %r{\Ahttps?://.*?\.\w{2,4}.*?\z}
    entity_escape(text)
  when %r{\A(www\..*|.*\.\w{2,4})\z}
    "https://#{entity_escape text}"
  when %r{\A.*?\.\w{2,4}\/?.*\z}
    "https://#{entity_escape text}"
  when %r{^@\w+$}
    "https://twitter.com/#{text.sub(/^@/, '')}"
  else
    nil
  end
end

url = make_link %x{__CF_USER_TEXT_ENCODING=$UID:0x8000100:0x8000100 pbpaste}.strip
print %Q{[%fill:Link Text%](#{url})}</string>
			<key>snippetType</key>
			<integer>3</integer>
			<key>uuidString</key>
			<string>BFDD8068-E9CF-45CC-908C-EF1A815EE946</string>
		</dict>
		<dict>
			<key>abbreviation</key>
			<string>mdr</string>
			<key>abbreviationMode</key>
			<integer>0</integer>
			<key>creationDate</key>
			<date>2022-09-15T05:03:00Z</date>
			<key>label</key>
			<string>Paste Markdown References</string>
			<key>modificationDate</key>
			<date>2022-09-15T05:03:00Z</date>
			<key>plainText</key>
			<string>#!/usr/bin/ruby

# Parses the clipboard for urls
# if it finds 1 or more, paste them as a list of markdown references
# if the links in the clipboard are already in markdown reference format, 
# it preserves their names and sorts the references

clipboard = %x{__CF_USER_TEXT_ENCODING=$UID:0x8000100:0x8000100 pbpaste}.strip
links = clipboard.scan /(?:\[([^\]]+)\]\: )?(https?:\/\/[^ \n\r"]+)/m

norepeat = []
output = []
exit if links.nil?

links.each {|url|
  fresh = true
  output.each {|a|
    fresh = false if a['link'] == url[1]
  }
  next unless fresh

	if url[0].nil?
		domain = url[1].match(/https?:\/\/([^\/]+)/)
		parts = domain[1].split('.')
		name = case parts.length
			when 1,2 
                        parts[0]
			else 
                        parts[1]
		end
	else
		name = url[0]
	end

  name = "itunes" if url[1] =~ /(itunes|phobos).apple.com/

	while norepeat.include? name
		name = name =~ / ?[0-9]$/ ? name.next! : name = name + " 2"
	end
	output &lt;&lt; {'title' =&gt; name, 'link' =&gt; url[1] }
	norepeat.push name
}

output.sort {|a,b| a['title'] &lt;=&gt; b['title']}.each { |x| puts "[#{x['title']}]: #{x['link']}" }</string>
			<key>snippetType</key>
			<integer>3</integer>
			<key>uuidString</key>
			<string>BF99209F-CD58-45A5-8843-9D702322D3AC</string>
		</dict>
		<dict>
			<key>abbreviation</key>
			<string>kittyg</string>
			<key>abbreviationMode</key>
			<integer>0</integer>
			<key>creationDate</key>
			<date>2022-09-15T05:03:00Z</date>
			<key>label</key>
			<string>Kitty Placeholder - Grey</string>
			<key>modificationDate</key>
			<date>2022-09-15T05:03:00Z</date>
			<key>plainText</key>
			<string>&lt;img src="http://placekitten.com/g/%filltext:name=width:width=20%/%filltext:name=height:width=20%" alt="KITTEH %filltext:name=width:width=20%x%filltext:name=height:width=20%" width="%filltext:name=width:width=20%" height="%filltext:name=height:width=20%" /&gt;</string>
			<key>snippetType</key>
			<integer>0</integer>
			<key>uuidString</key>
			<string>F5B36673-FC3D-44F3-8CD1-CA6F19F4C16C</string>
		</dict>
		<dict>
			<key>abbreviation</key>
			<string>kittyc</string>
			<key>abbreviationMode</key>
			<integer>0</integer>
			<key>creationDate</key>
			<date>2022-09-15T05:03:00Z</date>
			<key>label</key>
			<string>Kitty Placeholder - Color</string>
			<key>modificationDate</key>
			<date>2022-09-15T05:03:00Z</date>
			<key>plainText</key>
			<string>&lt;img src="http://placekitten.com/%filltext:name=width:width=20%/%filltext:name=height:width=20%" alt="KITTEH %filltext:name=width:width=20%x%filltext:name=height:width=20%" width="%filltext:name=width:width=20%" height="%filltext:name=height:width=20%" /&gt;</string>
			<key>snippetType</key>
			<integer>0</integer>
			<key>uuidString</key>
			<string>02ABADD7-51E6-4F6A-9312-75D1BEEC6215</string>
		</dict>
		<dict>
			<key>abbreviation</key>
			<string>href</string>
			<key>abbreviationMode</key>
			<integer>0</integer>
			<key>creationDate</key>
			<date>2022-09-15T05:03:00Z</date>
			<key>label</key>
			<string>Clipboard HTML Link</string>
			<key>modificationDate</key>
			<date>2022-09-15T05:03:00Z</date>
			<key>plainText</key>
			<string>#!/usr/bin/env ruby

def entity_escape(text)
  text.gsub(/&amp;(?!([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+);)/, '&amp;amp;')
end

def make_link(text)
  case text
  when %r{\A(mailto:)?(.*?@.*\..*)\z}
    "mailto:#{$2.gsub(/./) {sprintf("&amp;#x%02X;", $&amp;.unpack("U")[0])}}"
  when %r{\Ahttps?://.*?\.\w{2,4}.*?\z}
    entity_escape(text)
  when %r{\A(www\..*|.*\.\w{2,4})\z}
    "https://#{entity_escape text}"
  when %r{\A.*?\.\w{2,4}\/?.*\z}
    "https://#{entity_escape text}"
  when %r{^@\w+$}
    "https://twitter.com/#{text.sub(/^@/, '')}"
  else
    nil
  end
end

url = make_link %x{__CF_USER_TEXT_ENCODING=$UID:0x8000100:0x8000100 pbpaste}.strip
print %Q{&lt;a href="#{url}"&gt;%fill:Link Text%&lt;/a&gt;}</string>
			<key>snippetType</key>
			<integer>3</integer>
			<key>uuidString</key>
			<string>4EF96AC5-FD8C-4394-8586-D6C9819E57EB</string>
		</dict>
		<dict>
			<key>abbreviation</key>
			<string>fp</string>
			<key>abbreviationMode</key>
			<integer>0</integer>
			<key>creationDate</key>
			<date>2022-09-15T05:03:00Z</date>
			<key>label</key>
			<string>Front Finder Window Path</string>
			<key>modificationDate</key>
			<date>2022-09-15T05:03:00Z</date>
			<key>plainText</key>
			<string>-- credit to Dr. Drang &lt;http://www.leancrew.com/all-this/2013/01/textexpander-posix-paths-and-forgetfulness/&gt;
tell application "Finder" to get quoted form of POSIX path of (target of front Finder window as text)</string>
			<key>snippetType</key>
			<integer>2</integer>
			<key>uuidString</key>
			<string>1B8C12A3-4CE2-4394-83E9-7F6725E8B5B0</string>
		</dict>
		<dict>
			<key>abbreviation</key>
			<string>encemail</string>
			<key>abbreviationMode</key>
			<integer>0</integer>
			<key>creationDate</key>
			<date>2022-09-15T05:03:00Z</date>
			<key>label</key>
			<string>Encode email address</string>
			<key>modificationDate</key>
			<date>2022-09-15T05:03:00Z</date>
			<key>plainText</key>
			<string>#!/usr/bin/env ruby

clipboard = %x{__CF_USER_TEXT_ENCODING=$UID:0x8000100:0x8000100 pbpaste}.strip
print "mailto:#{$2.gsub(/./) {sprintf("&amp;#x%02X;", $&amp;.unpack("U")[0])}}" if clipboard =~ /\A(mailto:)?(.*?@.*\..*)\z/</string>
			<key>snippetType</key>
			<integer>3</integer>
			<key>uuidString</key>
			<string>D84050B0-9862-48CC-859D-63439FBDC55F</string>
		</dict>
		<dict>
			<key>abbreviation</key>
			<string>dummy</string>
			<key>abbreviationMode</key>
			<integer>0</integer>
			<key>creationDate</key>
			<date>2022-09-15T05:03:00Z</date>
			<key>label</key>
			<string>Dummy Image</string>
			<key>modificationDate</key>
			<date>2022-09-15T05:03:00Z</date>
			<key>plainText</key>
			<string>&lt;img src="http://placehold.it/%filltext:name=width:width=20%x%filltext:name=height:width=20%/333333/dddddd&amp;text=%filltext:name=title:width=20%" alt="%filltext:name=title:width=20%" width="%filltext:name=width:width=20%" height="%filltext:name=height:width=20%" /&gt;</string>
			<key>snippetType</key>
			<integer>0</integer>
			<key>uuidString</key>
			<string>9F67766C-D517-47E1-9DA6-AA74EF9BB743</string>
		</dict>
		<dict>
			<key>abbreviation</key>
			<string>curl</string>
			<key>abbreviationMode</key>
			<integer>0</integer>
			<key>creationDate</key>
			<date>2022-09-15T05:03:00Z</date>
			<key>label</key>
			<string>Current Chrome url</string>
			<key>modificationDate</key>
			<date>2022-09-15T05:03:00Z</date>
			<key>plainText</key>
			<string>tell application "Google Chrome" to return URL of active tab of window 1</string>
			<key>snippetType</key>
			<integer>2</integer>
			<key>uuidString</key>
			<string>9E28E13C-0CC5-407B-B32D-FAAE2DD68352</string>
		</dict>
		<dict>
			<key>abbreviation</key>
			<string>curb</string>
			<key>abbreviationMode</key>
			<integer>0</integer>
			<key>creationDate</key>
			<date>2022-09-15T05:03:00Z</date>
			<key>label</key>
			<string>Shorten current Chrome tab</string>
			<key>modificationDate</key>
			<date>2022-09-15T05:03:00Z</date>
			<key>plainText</key>
			<string>#!/usr/bin/ruby
# Bit.ly shortener TextExpander Snippet by Brett Terpstra
# Working as of Feb, 2021 but APIs are a'changin
# Create snippets for username (shortcut: #btlyu) and API key (shortcut: #btlya)
# Find your API key at http://bit.ly/a/your_api_key

require 'open-uri'
require 'cgi'

def entity_escape(text)
  text.gsub(/&amp;(?!([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+);)/, '&amp;amp;')
end

def make_link(text)
  case text
  when %r{\Ahttps?://.*?\.\w{2,4}.*?\z}
    entity_escape(text)
  when %r{\A(www\..*|.*\.\w{2,4})\z}
    "http://#{entity_escape text}"
  when %r{\A.*?\.\w{2,4}\/?.*\z}
    "http://#{entity_escape text}"
  else
    nil
  end
end

def get_chrome_url
  %x{osascript -e 'tell application "Google Chrome" to return URL of active tab of window 1'}.strip
end

USER_NAME = '%snippet:#btlyu%' # Your login name
API_KEY = '%snippet:#btlya%' 

url = get_chrome_url

res = open("https://api-ssl.bit.ly/v3/shorten?login=#{USER_NAME}&amp;apiKey=#{API_KEY}&amp;longUrl=#{CGI.escape(url)}&amp;format=txt").read unless url.nil?

begin
  print res.strip unless res.nil?
rescue
  exit
end</string>
			<key>snippetType</key>
			<integer>3</integer>
			<key>uuidString</key>
			<string>64B6C41C-DE8C-4A8F-B9CF-528C2CA704F0</string>
		</dict>
		<dict>
			<key>abbreviation</key>
			<string>cul</string>
			<key>abbreviationMode</key>
			<integer>0</integer>
			<key>creationDate</key>
			<date>2022-09-15T05:03:00Z</date>
			<key>label</key>
			<string>Clipboard -&gt; UL</string>
			<key>modificationDate</key>
			<date>2022-09-15T05:03:00Z</date>
			<key>plainText</key>
			<string>#!/usr/bin/ruby

# ruby script to make an unordered list from indented data. 

data = %x{__CF_USER_TEXT_ENCODING=$UID:0x8000100:0x8000100 pbpaste}.strip

result = "&lt;ul&gt;\n"
last_marker = []
last_marker[0] = ""

last_leading_space = ""
g_tab_width = 4
g_list_level = 0
last_list_level = 0

marker = item = leading_space = ''

data.split("\n").each {|line|
  next if line =~ /^[\s\t]*$/
  parts = line.match(/^([\t ]*)(\d+\. |[\*\+\-] )?\s*(.*)/)
  leading_space = parts[1]
  marker = parts[2]
  item = parts[3]
  leading_space.gsub!(/\t/,'    ')
  
  if leading_space.length &gt; last_leading_space.length + 3
    last_list_level = g_list_level
    g_list_level += 1
    last_leading_space = leading_space
    last_list_level = g_list_level
    result += "&lt;ul&gt;\n"
  elsif leading_space.length + 3 &lt; last_leading_space.length
    g_list_level = leading_space.length / 4
    last_leading_space = leading_space
    g_list_level-last_list_level.times do
      result += "&lt;/ul&gt;\n"
    end
    last_list_level = g_list_level
  end
  indent = ""

  result += "&lt;li&gt;#{item}&lt;/li&gt;\n"
} 

puts result + "&lt;/ul&gt;"
</string>
			<key>snippetType</key>
			<integer>3</integer>
			<key>uuidString</key>
			<string>C1CCF76D-375E-4B1F-94D3-FD9CFAD9A3E9</string>
		</dict>
		<dict>
			<key>abbreviation</key>
			<string>cl</string>
			<key>abbreviationMode</key>
			<integer>0</integer>
			<key>creationDate</key>
			<date>2022-09-15T05:03:00Z</date>
			<key>label</key>
			<string>CloudApp Direct Link</string>
			<key>modificationDate</key>
			<date>2022-09-15T05:03:00Z</date>
			<key>plainText</key>
			<string>#!/usr/bin/ruby
require 'open-uri'
require 'cgi'

def entity_escape(text)
  text.gsub(/&amp;(?!([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+);)/, '&amp;amp;')
end

def make_link(text)
  case text
  when %r{\Ahttps?://.*?\.\w{2,4}.*?\z}
    entity_escape(text)
  when %r{\A(www\..*|.*\.\w{2,4})\z}
    "http://#{entity_escape text}"
  when %r{\A.*?\.\w{2,4}\/?.*\z}
    "http://#{entity_escape text}"
  else
    nil
  end
end

input = make_link %x{__CF_USER_TEXT_ENCODING=$UID:0x8000100:0x8000100 pbpaste}.strip

open(input,"Accept" =&gt; "application/json") {|f|
	res = f.read.match(/"remote_url":"(.*?)"/)[1]
	print res unless res.nil?
}
</string>
			<key>snippetType</key>
			<integer>3</integer>
			<key>uuidString</key>
			<string>BFE1DBDF-8E23-45C1-9C45-DE8785FBECAD</string>
		</dict>
		<dict>
			<key>abbreviation</key>
			<string>-</string>
			<key>abbreviationMode</key>
			<integer>0</integer>
			<key>creationDate</key>
			<date>2022-09-15T05:03:00Z</date>
			<key>label</key>
			<string>Slugify clipboard</string>
			<key>modificationDate</key>
			<date>2022-09-15T05:03:00Z</date>
			<key>plainText</key>
			<string>#!/usr/bin/ruby

clip = %x{__CF_USER_TEXT_ENCODING=$UID:0x8000100:0x8000100 pbpaste}

print clip.downcase.gsub(/[^a-z0-9 \-_\.]/i, '').gsub(/\s+/,'-').gsub(/-+/,'-')

</string>
			<key>snippetType</key>
			<integer>3</integer>
			<key>uuidString</key>
			<string>B332F463-26A5-4345-9D79-459A84AB0197</string>
		</dict>
		<dict>
			<key>abbreviation</key>
			<string>avg</string>
			<key>abbreviationMode</key>
			<integer>0</integer>
			<key>creationDate</key>
			<date>2022-09-15T05:03:00Z</date>
			<key>label</key>
			<string>Average numbers in clipboard</string>
			<key>modificationDate</key>
			<date>2022-09-15T05:03:00Z</date>
			<key>plainText</key>
			<string>#!/usr/bin/env ruby

def ts( number )
  number.to_s.reverse.scan(/(?:\d*\.)?\d{1,3}-?/).join(',').reverse
end

def do_average(text)
  arr = text.scan(/\.?\d[\d,]+(?:\.\d+)?/).map{|line| 
    line.gsub(/[^\d\.]/,'').to_f
  }.sort

  return ts(arr.inject(0.0) { |sum,el| sum + el } / arr.size ) unless arr.empty?
end


print do_average %x{__CF_USER_TEXT_ENCODING=$UID:0x8000100:0x8000100 pbpaste}.strip</string>
			<key>snippetType</key>
			<integer>3</integer>
			<key>uuidString</key>
			<string>231000CB-4A27-428D-A44D-25C63BB4546D</string>
		</dict>
	</array>
</dict>
</plist>
