This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# When you export files from the Mac Photos app, it can generate a directory structure like this: | |
# ./ | |
# ./My Favorite Place - Some City, April 10, 1999 | |
# ./Some Other City, January 1, 1995 | |
# | |
# This script renames all those directories to follow this structure: | |
# ./ | |
# ./1995-01-01 Some Other City |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/python3 | |
import os | |
# Complete the commonChild function below. | |
def commonChild(s1, s2): | |
maxAt = {} | |
for i1 in range(len(s1)): | |
maxForI1 = 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var BACKUP_FOLDER_ID = 'INSERT_FOLDER_ID_HERE'; | |
var NATIVE_MIME_TYPES = {}; | |
NATIVE_MIME_TYPES[MimeType.GOOGLE_DOCS] = MimeType.MICROSOFT_WORD; | |
NATIVE_MIME_TYPES[MimeType.GOOGLE_SHEETS] = MimeType.MICROSOFT_EXCEL; | |
NATIVE_MIME_TYPES[MimeType.GOOGLE_SLIDES] = MimeType.MICROSOFT_POWERPOINT; | |
var NATIVE_EXTENSIONS = {}; | |
NATIVE_EXTENSIONS[MimeType.GOOGLE_DOCS] = '.docx'; | |
NATIVE_EXTENSIONS[MimeType.GOOGLE_SHEETS] = '.xlsx'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>net.brokensandals.photos.sync.applefromgoogle</string> | |
<key>Program</key> | |
<string>/Users/jacob/dotfiles/bin/sync-apple-photos-from-google-photos.rb</string> | |
<key>StartCalendarInterval</key> | |
<array> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
backup_dir=/Users/jacob/Backup/evernote-html | |
# thanks to http://veritrope.com/code/get-note-links-in-evernote-for-newly-created-notes/ for how to wait for sync to finish | |
osascript <<END | |
with timeout of (30 * 60) seconds | |
tell application "Evernote" | |
synchronize | |
repeat until isSynchronizing is false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; From John Gruber's http://daringfireball.net/2010/07/improved_regex_for_matching_urls | |
; Added a capture group around the protocol so we can distinguish matches that contained it. | |
(def url-regex #"(?i)\b((?:([a-z][\w-]+:(?:/{1,3}|[a-z0-9%]))|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'\".,<>?«»“”‘’]))") | |
(defn linkify-urls | |
"Add A tags around parts of the string that look likely to be URLs." | |
[text] | |
(let [matcher (re-matcher url-regex text)] | |
(if-not (.find matcher) | |
text ; avoid building a StringBuffer (and presumably copying the string) if there were no matches |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
TASK_NAMES = {'unit' => 'units', | |
'functional' => 'functionals', | |
'integration' => 'integration'} | |
tasks = {'unit' => [], | |
'functional' => [], | |
'integration' => []} | |
requested = ARGV.clone |