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
#!/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 "Safari" | |
set _source to do JavaScript "window.document.documentElement.outerHTML" in document 1 | |
set _name to name of document 1 | |
end tell | |
tell application "BBEdit" | |
make new text window with properties ¬ | |
{contents:_source, source language:"HTML", name:"Generated source: " & _name} | |
select insertion point before character 1 of text window 1 |