Instantly share code, notes, and snippets.

View 5rings.txt
Do not ignore the many ways in the world.
Do not seek after pleasures for yourself.
Do not rely on anything whatsoever.
Think little about yourself; think deeply about the world.
Never, in all your life, think greedy or desirous thoughts.
View bb-eslint.appleScript
(* Pipe eslint output into a BBEdit results window *)
tell application "BBEdit"
set mydoc to file of (document 1 of window 1)
end tell
set posixPath to POSIX path of mydoc
set cmd to "/usr/local/bin/node /usr/local/bin/eslint -c ~/.eslintrc.js -f unix " & (quoted form of POSIX path of mydoc) & " | /usr/local/bin/bbresults"
do shell script cmd
on error
View Copy Command to Clipboard.applescript
Copy UNIX command to return to current location in active BBEdit document
tell application "BBEdit"
set mydocs to every text document in window 1
if (length of mydocs is greater than 0) then
set props to get properties of selection
set mydoc to first item of mydocs
View sticky-clipboard.applescript
launch application "Stickies"
tell application "System Events" to tell process "Stickies"
click menu item "New Note" of menu "File" of menu bar 1
set frontmost to true
click menu item "Paste" of menu "Edit" of menu bar 1
end tell
View bbedit-documents-clipboard.applescript
Copy paths of all open text documents in the active BBEdit window to your clipboard
tell application "BBEdit"
set mydocs to every text document in window 1
set urls to ""
repeat with doc in mydocs
set myurl to (URL of doc)
if (myurl is not missing value) then
View safari-bbedit.appleScript
Open source of current Safari document in BBEdit
David Miller
set mycontents to ""
set myname to ""
# Get your brand new Mac setup properly
# show full path in Finder title bar
defaults write _FXShowPosixPathInTitle -bool true; killall Finder
# show hidden files in Finder
defaults write AppleShowAllFiles YES
killall Finder
View man-markdown.css
@charset "UTF-8";
html {
background: #fff;
body {
background: #fff;
View NSXMLNode+StringForXPath.m
#import "NSXMLNode+StringForXPath.h"
@implementation NSXMLNode (StringForXPath)
- (NSString *) stringForXPath:(NSString*)xpath
NSError *error;
NSArray *nodes = [self nodesForXPath:xpath error:&error];
if (error || nodes.count == 0)