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/python | |
from AppKit import NSWorkspace | |
import time | |
t = range(1,100) | |
for i in t: | |
time.sleep(3) | |
activeAppName = NSWorkspace.sharedWorkspace().activeApplication()['NSApplicationName'] | |
print activeAppName |
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
// Bookmarklet for Pinboard | |
// Show tweets in popular page | |
// Copied from https://www.onfocus.com/2016/11/6842/pinboard-popular-tweets | |
javascript:(function(){var%20s=document.createElement("script");s.type="text/javascript";s.src="https://platform.twitter.com/widgets.js";s.async=true;document.head.append(s);setTimeout(function(){var%20bookmarks=document.getElementsByClassName("bookmark_title");var%20tweets=new%20Array();for(var%20i=0;i<bookmarks.length;i++){var%20burl=bookmarks[i].getAttribute("href");var%20re=new%20RegExp("status\/(\\d{15,20})");var%20e=re.exec(burl);if(e!==null){bookmarks[i].innerHTML+='<div%20id="t'+e[1]+'"%20tweetID="'+e[1]+'"%20style="width:500px;"></div>';var%20id=e[1];var%20tweet=document.getElementById('t'+id);if(!tweets.includes(e[1])){twttr.widgets.createTweet(id,tweet,{conversation:'none',cards:'visible',linkColor:'#cc0000',theme:'light'});}tweets.push(e[1]);}}},500);})(); |
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
-- save as "Add Pinboard Bookmark.scpt" in ~/Library/Scripts/Applications/Safari | |
-- assign it ⌘D in FastScripts to use instead of Safari's bookmarks | |
tell application "Safari" | |
set pinboardBookmarklet to " | |
document.location = 'http://pinboard.in/add?next=same' + | |
'&url=' + encodeURIComponent(location.href) + | |
'&title=' + encodeURIComponent(document.title); | |
" | |
do JavaScript pinboardBookmarklet in document 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
-- Maketags | |
-- | |
-- Builds ctags file for currently active project | |
-- | |
-- Installation: | |
-- | |
-- Copy script to either location: | |
-- ~/Library/Application Support/BBEdit/Scripts | |
-- ~/Dropbox/Application Support/BBEdit/Scripts | |
-- |