Skip to content

Instantly share code, notes, and snippets.

@Zettt
Zettt / Mega Lipsum.scpt
Created February 2, 2011 18:17
Grabs a set amount of paragraphs of Lipsum from lipsum.com
-- Grabs a set amount of paragraphs of Lipsum from lipsum.com
--
-- Created by Zettt on 2011-02-02
-- Mac OS X Screencasts http://macosxscreencasts.com
--
-- Original from Brett Terpstra
-- http://brettterpstra.com/random-lipsum-for-textexpander/
--
-- This script can be used with Keyboard Maestro, LaunchBar
-- or similar apps.
-- OmniFocus (or many other apps) to Pomodoro App for iPad
-- This script practically takes text that's on your clipboard
-- and generates a Pomodoro App for iPad compatible JSON file
-- to import into the app. (using Dropbox)
--
-- I'm using it with OmniFocus, where copied tasks remain
-- on the clipboard as lines of text, basically.
--
-- Created by Andreas on 2011-02-17
-- http://www.macosxscreencasts.com
@Zettt
Zettt / rtime.applescript
Last active September 26, 2015 10:17
Inserts rounded time (15 minutes). Can be called from, e.g. TextExpander. (AppleScript version)
set currentHour to hours of (current date)
set currentMinute to minutes of (current date)
if (currentHour ≥ 0) and (currentHour < 10) then
set currentHour to "0" & currentHour
end if
if (currentMinute ≥ 0) and (currentMinute ≤ 7) then
set currentMinute to "00"
else if (currentMinute > 7) and (currentMinute ≤ 23) then
@Zettt
Zettt / minecraft-ln-s.sh
Created August 16, 2011 20:20
Backing up/moving your Minecraft folder to a new location and linking back to the old location so Minecraft thinks it wasn't moved.
# Moving to a new location.
# This can actually be done in Nautilus as well.
mv ~/.minecraft/ /mnt/mythumbdrive/
# Link back to the original location.
# Note how the last part needs to be the same location as in the previous command.
# ~ is short for /home/YOURUSER
ln -s /mnt/mythumdrive/minecraft/ /home/YOURUSER/.minecraft
@Zettt
Zettt / Extract Icons Service.sh
Created September 15, 2011 14:43
Extract icons from apps with a service. Add Filter Finder Items action (Kind:Apps) and Run Shell Script action with the following script.
mkdir $HOME/Desktop/AppIcons/
for CURRENTAPP in "$@"; do
APPDIR="$1"
ICON=`defaults read "$APPDIR/Contents/Info" CFBundleIconFile|sed -e 's/\.icns$//'`
ICONFILE="$APPDIR/Contents/Resources/$ICON.icns"
APPNAME=`basename "$APPDIR" .app`
OUTFILE="$HOME/Desktop/AppIcons/${APPNAME}.icns"
cp -f "$ICONFILE" "$OUTFILE"
shift
@Zettt
Zettt / idioms.rb
Created November 11, 2011 12:05
Show random idiom on desktop using GeekTool
srand # seed random
require 'csv'
wordArray = Array.new
definitionArray = Array.new
if File.exists?("/Users/zettt/Archive/Vocab/idioms.csv")
CSV.open('/Users/zettt/Archive/Vocab/idioms.csv', 'r') do |row|
# p row[1]
@Zettt
Zettt / #nowplaying.applescript
Created November 8, 2012 11:31
AppleScript that gets currently playing track with title and name and whatnot and returns it only if iTunes is running. Useful for TextExpander snippets. (Include in optional section)
tell application "System Events"
if not (exists process "iTunes") then return
end tell
tell application "iTunes"
tell playlist "Rating = 5"
set trackCount to count of tracks
set randomTrackNumber to random number from 1 to trackCount
set trackTitle to name of track randomTrackNumber
set trackArtist to artist of track randomTrackNumber
@Zettt
Zettt / New OmniFocus Task.py
Created November 23, 2012 17:59
New OmniFocus Task
import webbrowser
import urllib
# omnifocus:///add?name=[prompt]&note=[prompt]
omnifocus_url = "omnifocus:///add?"
task_name_url = "name="
note_url = "note="
# input
prompt = "> "
@Zettt
Zettt / label finder items.applescript
Last active December 14, 2015 20:19
Set Color Label for selected Finder items
(*
No color = 0
Orange = 1
Red = 2
Yellow = 3
Blue = 4
Purple = 5
Green = 6
Gray = 7
*)
@Zettt
Zettt / Action.scpt
Last active December 18, 2015 05:48
Wrapper Plugin
set wrapStart to system attribute "KMPARAM_WrapStart" -- as Unicode text
set wraptext to system attribute "KMPARAM_Text" -- as Unicode text
set wrapEnd to system attribute "KMPARAM_WrapEnd" -- as Unicode text
return wrapStart & wraptext & wrapEnd