Skip to content

Instantly share code, notes, and snippets.

View amagliul's full-sized avatar

Tony amagliul

  • odrive
View GitHub Profile
@amagliul
amagliul / redditcli.py
Created April 25, 2026 17:56
redditcli — read-only Reddit saved/upvoted exporter (OAuth, stdlib only)
#!/usr/bin/env python3
"""
redditcli - pull your own saved/upvoted Reddit listings to local NDJSON.
Strictly read-only. Touches only these endpoints, all scoped to the
authenticated user's own account:
POST /api/v1/access_token OAuth2 password grant
GET /user/{me}/saved the user's own saved posts/comments
GET /user/{me}/upvoted the user's own upvoted posts
@amagliul
amagliul / gist:c0ba2abd86e1cf88c97177b5c465fe86
Created February 15, 2024 21:45
Applescript and python to export Apple Notes to .txt files and retain note dates as file modification times
tell application "Notes"
-- The Notes account type here (Google, iCloud, etc..)
set noteAccount to "iCloud"
repeat with currentNote in notes of account noteAccount
log "Processing note: " & (name of currentNote)
set noteTitle to name of currentNote
set noteContent to body of currentNote
-- Sanitize filename (remove slashes, etc.)
set safeTitle to do shell script "echo " & quoted form of noteTitle & " | tr / - | tr ':' '_' "
@amagliul
amagliul / gist:040a542626c22cfd3c2b471d55b098f8
Created February 15, 2024 19:53
Applescript to export Apple Notes to .txt files
tell application "Notes"
-- The Notes account type here (Google, iCloud, etc..)
set noteAccount to "iCloud"
repeat with currentNote in notes of account noteAccount
log "Processing note: " & (name of currentNote)
set noteTitle to name of currentNote
set noteContent to body of currentNote
-- Sanitize filename (remove slashes, etc.)
set safeTitle to do shell script "echo " & quoted form of noteTitle & " | tr / - | tr ':' '_' "