Skip to content

Instantly share code, notes, and snippets.

set completion-ignore-case On
set show-all-if-ambiguous on
"\e[A": history-search-backward
"\e[B": history-search-forward
# Cycle through completions by pressing tab
"\t": menu-complete
@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.
@Zettt
Zettt / round time.scpt
Created February 2, 2011 20:56
Short TextExpander snippet to round the current time to a quarter hour.
set currentHour to hours of (current date)
set currentMinute to minutes of (current date)
if (currentMinute ≥ 0) and (currentMinute ≤ 7) then
set currentMinute to "00"
else if (currentMinute > 7) and (currentMinute ≤ 23) then
set currentMinute to "15"
else if (currentMinute > 23) and (currentMinute ≤ 37) then
set currentMinute to "30"
else if (currentMinute > 37) and (currentMinute ≤ 52) then
-- 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
-- Things to Pomodoro App for iPad
-- This script asks Things for the currently selected todos
-- and generates a Pomodoro App for iPad compatible JSON file
-- for you to import in to the app (using Dropbox)
--
-- Created by Thomas on 2011-02-17
-- Inspired by Andreas on 2011-02-17
-- Modified by Andreas on 2011-02-17
-- Original: https://gist.github.com/832075
-- https://gist.github.com/831942
@Zettt
Zettt / Open Disk Images.sh
Created April 13, 2011 18:53
Hazel script that will open .dmg files in the background without any interaction required. (It auto-accepts any confirmation dialog.)
#!/bin/sh
file="$1"
extension=${file##*.}
if [[ $extension == "dmg" ]]; then
echo "yes" | hdiutil attach "$1"
fi
@Zettt
Zettt / rtime.sh
Created July 13, 2011 21:01
Inserts rounded time (15 minutes). Can be called from, e.g. TextExpander.
#!/bin/sh
hours=`date "+%H"`
let minutes=`date "+%M"`
if [[ $minutes -ge 0 ]] && [[ $minutes -le 7 ]]; then
minutes="00"
elif [[ $minutes -gt 7 ]] && [[ $minutes -le 23 ]]; then
minutes="15"
elif [[ $minutes -gt 23 ]] && [[ $minutes -le 37 ]]; then
@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