View element-scrollto.js
/**
Smoothly scroll an element into the browser viewport
@param element {HTMLElement} - the element that which should be scrolled into the viewport
@param duration {Integer} - # of milliseconds the animation should take to complete
*/
var scroll = function (selector, duration) {
var
offset = function(element) {
View jshint-bbedit.applescript
(* https://readmeansrun.com *)
try
tell application "BBEdit"
set mydoc to file of (document 1 of window 1)
end tell
set posixPath to POSIX path of mydoc
if (posixPath ends with ".js" or posixPath ends with ".json") then
set cmd to "/usr/local/bin/node /usr/local/bin/jshint " & (quoted form of POSIX path of mydoc) & " | /usr/local/bin/bbresults -e --pattern '(?P<file>.+?):\\sline\\s(?P<line>\\d+),\\scol\\s((?P<col>\\d+),)?\\s+(?P<msg>.*)$'"
do shell script cmd
end if
View BBEdit Close Others.applescript
try
tell application "BBEdit"
set mywindow to window 1
set mydoc to (URL of document 1 of mywindow) as POSIX file
set alldocs to documents of mywindow
repeat with doc in alldocs
if ((((URL of doc) as POSIX file) as string) is equal to (mydoc as string)) then
-- active doc
else
View ubuntu-bootstrap.sh
# https://www.linode.com/docs/security/use-public-key-authentication-with-ssh
mkdir -p ~/.ssh && sudo chmod -R 700 ~/.ssh/
# add node user
sudo adduser node
sudo adduser node sudo
# packages
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
View BBEdit → LaunchBar
try
tell application "BBEdit"
set mydoc to (URL of document 1 of window 1) as POSIX file
end tell
tell application "LaunchBar"
open mydoc
end tell
on error
beep
end try