Skip to content

Instantly share code, notes, and snippets.

View lcn2's full-sized avatar

Landon Curt Noll lcn2

View GitHub Profile
@dustinknopoff
dustinknopoff / README.md
Last active December 12, 2024 19:57
Automatically Save emails to a folder using Mail.app, AppleScript, and Bash.

How to get it to work.

NOTE: This is mac only.

  1. Go to Finder.
  2. Press CMD+SHIFT+G.
  3. Type ~/Library/Application Scripts/com.apple.mail.
  4. Open saveByRule.scpt and change theFolder to where you'd like emails to be saved.
  5. Copy and Paste saveByRule.scpt into ~/Library/Application Scripts/com.apple.mail.
  6. Go to Mail>Preferences>Rules>Add Rule.
@ilyakurdyukov
ilyakurdyukov / safesys.h
Last active January 19, 2022 04:32
Helper function for escaping special characters from user-provided strings to be used in calls to system().
#ifndef SAFESYS_H
#define SAFESYS_H
#include <stdlib.h>
#include <stdarg.h>
#ifndef SAFESYS_NOMEM
#include <errno.h>
#define SAFESYS_NOMEM ENOMEM
#endif