Skip to content

Instantly share code, notes, and snippets.

@florido
florido / Delete Completed Reminders.applescript
Last active March 15, 2017 03:45 — forked from ryanlaner/gist:02b10ddbc68251cd9f1c
Apple Reminders.app -- Delete Completed Reminders
set the theList to {"Reminders", "Groceries"} -- Edit/Add all Reminder lists to remove completed items from
repeat with eachList in theList
tell application "Reminders"
-- Loop thru reminders in the targeted reminder.app list
tell list eachList
set theTasks to every reminder
repeat with theTask in theTasks
if theTask is completed then
@florido
florido / DevonThink Search operators
Last active November 16, 2023 10:41 — forked from keicoder/snippet.txt
DevonThink Search operators
DevonThink Search operators
In the toolbar search field, as well as in both the interactive and the simple web interface, you can use standard and extended Boolean operators, parenthesis, and more to fine tune your search.
The syntax of the operators is compatible to DEVONagent and EasyFind, the Finder, Spotlight, common search engines as well as common programming languages such as C, C++, Objective-C, Java, and JavaScript. The complexity of the query is unlimited.
Case
All terms are case-insensitive. You may, if you wish, use capitalization for proper names in a query, but DEVONthink Pro Office will ignore case in interpreting the query.
@florido
florido / QLTextFiles.sh
Created March 15, 2017 03:49 — forked from pavel-sakun/QLTextFiles.sh
Use OSX Finder Quicklook to preview all plain text files. Handy shortcut for actions need to install QLStephen plugin for OSX Finder's QuickLook. Please find info on QLStephen at https://github.com/whomwah/qlstephen Usage: curl https://raw.github.com/gist/6192519 | sh
#!/bin/bash
curl -O http://cloud.github.com/downloads/whomwah/qlstephen/QLStephen.qlgenerator.zip
unzip QLStephen.qlgenerator.zip
echo "Please enter your password when asked (the one sudo asks you for usuqlly). It's needed to copy some files to /Library/QuickLook"
sudo mv -f QLStephen.qlgenerator /Library/QuickLook
rm QLStephen.qlgenerator.zip
qlmanage -r
echo "We're done. Have fun and do not forget to give a credit to QLStephen's author Duncan@https://github.com/whomwah"
@florido
florido / Modify PATH
Last active June 5, 2018 00:33 — forked from nellynette/Modify PATH
Modify PATH
#to set the variable PATH to the value /bin:/sbin:/user/bin:/user/sbin:/system/Library/, you would enter the following command in a Terminal window:
$ PATH=/bin:/sbin:/user/bin:/user/sbin:/system/Library/ export PATH
#This modifies the environment variable PATH with the value assigned.
#To view all environment variables, enter:
$ env
New PATH
Prioritize local folder instead of system folder

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

@florido
florido / jekyll-and-liquid.md
Created March 29, 2017 11:18 — forked from magicznyleszek/jekyll-and-liquid.md
Jekyll & Liquid Cheatsheet

Jekyll & Liquid Cheatsheet

A list of the most common functionalities in Jekyll (Liquid). You can use Jekyll with GitHub Pages, just make sure you are using the proper version.

Running

Running a local server for testing purposes:

@florido
florido / osx-pdf-from-markdown.markdown
Created March 29, 2017 11:57 — forked from georgiana-gligor/osx-pdf-from-markdown.markdown
Markdown source for the "Create PDF files from Markdown sources in OSX" article

Create PDF files from Markdown sources in OSX

When [Markdown][markdown] appeared more than 10 years ago, it aimed to make it easier to express ideas in an easy-to-write plain text format. It offers a simple syntax that takes the writer focus away from the formatting, thus giving her time to focus on the actual content.

The market abunds of editors to be used for help with markdown. After a few attempts, I settled to Sublime and its browser preview plugin, which work great for me and have a small memory footprint to accomplish that. To pass the results around to other people, less technical, a markdown file and a bunch of images is not the best approach, so converting it to a more robust format like PDF seems like a much better choice.

[Pandoc][pandoc] is the swiss-army knife of converting documents between various formats. While being able to deal with heavy-weight formats like docx and epub, we will need it for the more lightweight markdown. To be able to generate PDF files, we need LaTeX. On OSX, the s

@florido
florido / watchfile.sh
Created March 31, 2017 01:13 — forked from swarminglogic/watchfile.sh
watchfile - monitor file(s) and execute a command when files are changed
#!/bin/bash
version=1.0.1
versionDate="2014-02-14"
function showHelp() {
echo "watchfile - monitor file(s)/command and perform action when changed
Possible ways of usage
----------------------------------------
@florido
florido / .profile
Created April 8, 2017 02:47 — forked from bmhatfield/.profile
Automatic Git commit signing with GPG on OSX
# In order for gpg to find gpg-agent, gpg-agent must be running, and there must be an env
# variable pointing GPG to the gpg-agent socket. This little script, which must be sourced
# in your shell's init script (ie, .bash_profile, .zshrc, whatever), will either start
# gpg-agent or set up the GPG_AGENT_INFO variable if it's already running.
# Add the following to your shell init to set up gpg-agent automatically for every shell
if [ -f ~/.gnupg/.gpg-agent-info ] && [ -n "$(pgrep gpg-agent)" ]; then
source ~/.gnupg/.gpg-agent-info
export GPG_AGENT_INFO
else
@florido
florido / up
Created December 13, 2017 22:25 — forked from mayel/up
up - script to keep your Mac up-to-date (OS, Homebrew, and App Store updates) via the command line
#!/bin/sh
# up - v2 - script to keep your Mac up-to-date (OS, Homebrew, and App Store updates) via the command line
# run thus to to install: cd /usr/local/bin && curl -s -O https://gist.githubusercontent.com/mayel/c07bc0acb91824501d5bdbdc9eb7b33a/raw/08821f64c067327ea68a1a817eb43657db10f10e/up && chmod 755 /usr/local/bin/up
# and then run it anytime by simply entering the command: up
# By https://github.com/mayel based on a script by https://github.com/imwally
# homebrew