Skip to content

Instantly share code, notes, and snippets.

View jduprey's full-sized avatar

John Duprey jduprey

  • Thomson Reuters
  • New York
  • 05:36 (UTC -05:00)
  • X @jduprey
View GitHub Profile
@jduprey
jduprey / OpenURLInChromeWindow.scpt
Created May 22, 2017 12:40
An Applescript that will open links clicked outside of the browser into a NEW Google Chrome WINDOW, instead of a TAB. [Mac OS X]
-- Based on numerous posts, but mainly this one: http://smoove-operator.blogspot.com/2011/06/open-links-from-external-applications.html?showComment=1456344705609#c2945803548300096133
-- See alos: https://apple.stackexchange.com/questions/9500/how-to-make-chrome-open-a-new-window-for-external-links
on handle_url(args)
tell application "/Applications/Google Chrome.app"
make new window
activate
set URL of active tab of first window to |URL| of args
end tell
return 1
end handle_url
@jduprey
jduprey / Hangman-Version-1.markdown
Created February 13, 2015 18:26
Hangman Version 1
@jduprey
jduprey / restore_db_conflicted.sh
Last active June 12, 2020 20:29
Bash Script to Restore Dropbox Conflicted Copy
# This script takes a single parameter - a file name following Dropbox "conflicted" file naming format.
# It will then ask you if you want skip, delete, or move it back (restore it) to the original file name.
# The original file name is determined by removing the Drobox conflicted part of the name.
# e.g. "demo-current (Thor's conflicted copy 2014-09-14).png" --> "demo-current.png"
# If you answer 'y' it will perform a 'NIX mv "SOURCE" "TARGET" command.
#
# Typical usage of this script would be something like the following:
# find . -name "*(*'s conflicted copy [0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9])*" -exec restore_db_conflicted.sh.sh {} \;
# -- Find all the files that look like conflicted copies and run the restore script on them.
# I've used this script a couple of times. It worked for me.