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
javascript:window.location='tweetbot:///post?text='+encodeURIComponent(document.title)+'%20-%20'+encodeURIComponent(window.location) |
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 this line of javascript as a bookmarklet. Will strip out utm_* nonsense | |
javascript:window.location='twitter://post?message='+encodeURIComponent(document.title+':%20'+window.location.href.replace(/\?utm_.*/i, '')) |
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
(* | |
OopsieFocus | |
A script to launch OmniFocus and activate the Quick Entry Panel | |
By Shawn Blanc (http://shawnblanc.net) | |
May 20, 2011 | |
With code used from the Toggle Twitter script by Red Sweater Software: | |
http://www.red-sweater.com/blog/1646/toggle-twitter |
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 change_desktop image_path | |
`osascript <<EOD | |
tell application "Finder" | |
set theFile to POSIX file "#{image_path}" | |
set desktop picture to theFile | |
end tell | |
EOD |
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 "BBEdit" | |
tell window 1 | |
select insertion point after line (startLine of selection) | |
set selection to return | |
select insertion point before line ((startLine of selection) + 1) | |
end tell | |
end tell |
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
def get_movie_duration video_file | |
# Run ffmpeg on the video, and do it silently | |
ffmpeg_output = `/usr/local/bin/ffmpeg -i "#{video_file}" 2>&1` | |
# Find the duration in the output, and force a return if it's found | |
/duration: ([0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{2})/i.match(ffmpeg_output) { |m| return m[1] } | |
# If it didn't get a match, something is wrong. Log the error | |
return "FFMPEG ERROR" |
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 "BBEdit" | |
set _sel to the selection | |
set _lines to lines in selection | |
set tasks_added to {} | |
repeat with _line in _lines | |
if length of _line is not 0 then | |
my makeOFTask(_line as text) | |
set end of tasks_added to _line as text | |
end if | |
end repeat |
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 | |
require 'rubygems' | |
require 'maruku' | |
def markdown(text) | |
html = Maruku.new(text).to_html_document | |
end | |
puts markdown(ARGF.read) |
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
Show hidden characters
{ | |
"cmd": ["open","-a","/Applications/Marked.app","$file"], | |
"selector": "text.html.markdown" | |
} |
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
// Display Spotify songs inline | |
if (displaySpotifySongs) { | |
Campfire.SpotifyExpander = Class.create({ | |
initialize: function(chat) { | |
this.chat = chat; | |
var messages = this.chat.transcript.messages; | |
for (var i = 0; i < messages.length; i++) { | |
this.detectSpotifyURL(messages[i]); |