Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
PATH=/usr/local/bin:/usr/local/sbin:~/bin:/usr/bin:/bin:/usr/sbin:/sbin
networksetup -setairportpower en0 off
@paulate
paulate / ReplyToOriginalSender
Last active November 30, 2015 09:20
Mail.app Applescript / Automator Service "reply" workaround - read about it here http://blog.itshunkydory.com/post/134258384314/mailapp-reply-hack
tell application "Mail" to activate
tell application "System Events"
tell process "Mail"
keystroke "r" using {command down, shift down}
delay 1
keystroke tab using shift down
keystroke tab using shift down
keystroke "a" using command down
keystroke "x" using command down
keystroke tab using shift down
@paulate
paulate / map
Last active August 29, 2015 13:56
//map function
function map(value, start1, stop1, start2, stop2) {
var mappedValue = ((value-start1)/(stop1 - start1))*(stop2-start2)+start2;
return mappedValue;
}