set linkText to "%fill:text%"
try
tell application "Safari"
set currentURL to URL of current tab of front window
end tell
set link to "[" & linkText & "](" & currentURL & ") "
return link
on error
"None"
#!/usr/bin/env ruby | |
require 'choice' | |
USERNAME = 'kristianfr' | |
# Get some command-line arguments (or one) | |
Choice.options do | |
option :export, :required => true do | |
short '-e' |
# Custom status bar | |
# # Powerline symbols: ⮂ ⮃ ⮀ ⮁ ⭤ | |
set -g status-left-length 32 | |
set -g status-right-length 150 | |
set -g status-interval 5 | |
set -g status-left '#[fg=colour16,bg=colour254,bold] #S #[fg=colour254,bg=colour234,nobold]⮀' | |
set -g status-right '#[fg=colour245]⮃ %R ⮃ %d %b #[fg=colour254,bg=colour234,nobold]#(~/Documents/AppleScripts/itunes-current-track-tmux.sh)⮂#[fg=colour16,bg=colour254,bold] #h ' | |
# set -g status-right '#(~/Documents/AppleScripts/itunes-current-track-tmux.sh)' | |
set -g window-status-format "#[fg=white,bg=colour234] #I #W " | |
set -g window-status-current-format "#[fg=colour234,bg=colour39]⮀#[fg=colour16,g=colour39,noreverse,bold] #I ⮁ #W #[fg=colour39,bg=colour234,nobold]⮀" |
require 'date' | |
require 'time' | |
dates = File.open('dates.txt') | |
csv_array = Array.new | |
dates.readlines.each_with_index do |line, i| | |
next if i == 0 | |
t = Time.parse(line) | |
fixed_date = t.strftime("%F") |
square = File.new "foursquare.kml" | |
date_array = Array.new | |
square.readlines.each do |line| | |
date = line.match(/<updated>\w*, \S* \w* \S* \S* \+0000<\/updated>/) | |
date_array << date | |
end | |
puts date_array |
## Tent.io work | |
require 'json' | |
require 'time' | |
# Change these to suit your needs | |
# You probably don't want my posts. | |
username = "kmf" | |
post_location = "/Users/kristian/Dropbox/ifttt/tent" | |
Dir.chdir post_location |
#!/bin/sh | |
echo "Checking for mencoder..." | |
if ! type "mplayer" > /dev/null; then | |
echo "mencoder not found. Attempting install with brew" | |
if ! type "brew" > /dev/null; then | |
echo "Homebrew not installed. Fail." | |
exit | |
fi |
set linkText to "%fill:text%"
try
tell application "Safari"
set currentURL to URL of current tab of front window
end tell
set link to "[" & linkText & "](" & currentURL & ") "
return link
on error
"None"
One of my gripes with Slogger is that when Instagram photos are added, they have no text captions. This makes sense though — the built-in system for adding photos is really as simple as passing the image as an argument.
Still, there had to be a way to make this work! I decided that with a little tweaking of my current IFTTT script, I could get captions included in my Day One entries.
The best way to do this is to setup your IFTTT script to download photos to Dropbox with good file-names. Mine's really simple; it's just CAPTION.jpg. Yep. With the text parsing I'm doing, this works just fine. If I want to sort by date, I can simply sort in Finder by "Date Added". No complaints there. Now for the code.
Let's start with slogger_image.rb
, the file used for importing Instagram photos.
After line 12, we see where the file is added as a variable:
alfredapp://customsearch/Subtitles%20Search/subs/ascii/url=http://www.opensubtitles.org/en/search2/sublanguageid-eng/moviename-{query} |
A simple TextExpander snippet for pasting a nice-looking version of your "Now Playing" from iTunes. Uses Applescript — if you have a different music player (Spotify, for example), it probably has similar Applescript support.
For example: ♫ "My Favourite Things" - John Coltrane (The Very Best of John Coltrane, 2000)
set the_string to ""
tell application "iTunes"
if player state is playing then
set the_string to "\"" & name of current track & "\""
if artist of current track is not "" then