Skip to content

Instantly share code, notes, and snippets.

Last updated: 2017-03-18

Searching for Files

Find images in a directory that don't have a DateTimeOriginal

exiftool -filename -filemodifydate -createdate -r -if '(not $datetimeoriginal) and $filetype eq "JPEG"' .

###Output photos that don't have datetimeoriginal to a CSV### Note this can take a long time if you have a lot of jpgs

Last updated: 2014-12-25

mdfind commands

Find all the file types in a given directory

mdfind -attr kMDItemContentType "kMDItemContentType == '*'" -onlyin . | awk -F"kMDItemContentType =" '{print $2}' | sort | uniq -c | sort -r

Get Last 5 Files Added in Dropbox Folders

app = Application("PdfPenPro")
app.includeStandardAdditions = true;
templatePath = Path("/Users/username/Rent Receipt Template.pdf")
savePath = Path("/Users/rjames/apartment")
var getByName = function(fileName){
return app.documents.byName(fileName);
}
"""
You can download the flickr API by running
pip install flickrapi
Info here:
http://stuvel.eu/media/flickrapi-docs/documentation/2-calling.html
You'll need to create a Flickr API app here:
function getMeta(metaName) {
const metas = document.getElementsByTagName('meta');
for (let i = 0; i < metas.length; i++) {
if (metas[i].getAttribute('property') === metaName) {
return metas[i].getAttribute('content');
}
}
return '';
@rjames86
rjames86 / decode_text.md
Created March 2, 2014 20:29
Actions for Launch Center Pro on iOS

Decode text from the clipboard

launch://clipboard/convert?format=urldecode
Safari = Application('Safari');
Safari.includeStandardAdditions = true;
SystemEvents = Application('System Events')
SystemEvents.includeStandardAdditions = true;
activeAppName = SystemEvents.processes.whose({frontmost:true}).at(0).name();
activeApp = Application(activeAppName);
function run(){
frontWindow = Safari.windows.at(0);
SystemEvents.activate()
sqlite3 -header -csv "$HOME/Library/Application Support/Alfred 3/Databases/clipboard.alfdb" "select item, app from clipboard;" > ~/Desktop/out.csv
function ga_code_search() {
# alias todo='ga_code_search "TODO\(`whoami`\)"'
SCREEN_WIDTH=`stty size | awk '{print $2}'`
SCREEN_WIDTH=$((SCREEN_WIDTH-4))
# Given a spooky name so you can alias to whatever you want.
# (cs for codesearch)
# AG is WAY faster but requires a binary
# (try brew install the_silver_searcher)
function ga_code_search() {
# alias todo='ga_code_search "TODO\(`whoami`\)"'
SCREEN_WIDTH=`stty size | awk '{print $2}'`
SCREEN_WIDTH=$((SCREEN_WIDTH-4))
# Given a spooky name so you can alias to whatever you want.
# (cs for codesearch)
# AG is WAY faster but requires a binary
# (try brew install the_silver_searcher)