Skip to content

Instantly share code, notes, and snippets.

View jweisber's full-sized avatar

Jonathan Weisberg jweisber

View GitHub Profile
@jweisber
jweisber / mac-terminal
Last active December 11, 2017 05:36
Open iTerm from Rstudio: replace /Applications/RStudio.app/Contents/MacOS/mac-terminal (see http://tinyurl.com/jvf6lbx, which is now out of date).
#!/usr/bin/osascript
on run argv
set dir to quoted form of (first item of argv)
if application "iTerm" is running then
set wasRunning to true
else
set wasRunning to false
end if
@jweisber
jweisber / workaround.js
Last active August 29, 2015 14:18
Workaround for IE 10/11 textarea placeholder bug
// Work around a bug in IE 10/11: http://tinyurl.com/qykro7d
// The bug makes any empty textarea's placeholder its value.
// We undo that wherever it's happened.
jQuery(function() {
$('textarea').each(function() {
if ($(this).val() === $(this).attr('placeholder')) {
$(this).val('');
}
});