Skip to content

Instantly share code, notes, and snippets.

View tgray's full-sized avatar
😬
.

Tim Gray tgray

😬
.
View GitHub Profile
@tgray
tgray / flickr-upload.py
Created February 18, 2024 00:04
Quick script to upload an image to flickr. The auth stuff should work too but has not been tested recently.
#!/usr/bin/env python
# https://pypi.org/project/flickrapi/
from flickrapi import FlickrAPI
from os.path import basename, splitext
import sys, os
import exiftool
import argparse
<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:g="http://base.google.com/ns/1.0" version="2.0">
<channel>
<title>Jon Carling</title>
<link>https://joncarling.bigcartel.com</link>
<description>Welcome to my shop.
Thank you for looking!
</description>
@tgray
tgray / Reformat table.py
Created April 29, 2022 15:48
Markdown table scripts
#!/usr/bin/env python
import sys
def just(string, type, n):
"Justify a string to length n according to type."
if type == '::':
return string.center(n)
elif type == '-:':
@tgray
tgray / Ledger.plist
Created February 17, 2022 11:35 — forked from mixio/Ledger.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BBEditDocumentType</key>
<string>CodelessLanguageModule</string>
<key>BBLMColorsSyntax</key> <true/>
<key>BBLMIsCaseSensitive</key> <false/>
<key>BBLMLanguageCode</key>
<string>Ldgr</string>
@tgray
tgray / hdcd-decode.md
Created July 5, 2020 18:50
HDCD decoding

HDCD decoding

The following used [ffmpeg][] to detect and decode files, and [sox][] to adjust gain.

Detection

The following shell script will detect HDCD files that were ripped bit-perfect (EAC/XLD).

#!/bin/sh -
@tgray
tgray / follow-up.omnijs
Last active May 5, 2021 12:18
Omni automation scripts for OmniFocus
/*{
"type": "action",
"targets": ["omnifocus"],
"author": "Tim Gray",
"identifier": "com.125px.FollowUp",
"version": "1.0",
"description": "This action will tag the selected task with 'Follow Up' and move the defer and due dates by one week.",
"label": "Follow Up",
"shortLabel": "Follow Up"
}*/
<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:cc="http://web.resource.org/cc/" xmlns:rss="http://purl.org/rss/1.0/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/">
<rss:channel rdf:about="https://physicstoday.scitation.org/loi/pto?af=R">
<rss:title>American Institute of Physics: Physics Today: Table of Contents</rss:title>
<rss:description>Table of Contents for Physics Today. List of articles from both the latest and ahead of print issues.</rss:description>
<rss:link>https://physicstoday.scitation.org/loi/pto?af=R</rss:link>
<dc:title>American Institute of Physics: Physics Today: Table of Contents</dc:title>
<dc:publisher>American Institute of Physics</dc:publisher>
<dc:language>en-US</dc:language>
<publicationName>Physics Today</publicationName>
@tgray
tgray / import_dayone.py
Created February 13, 2016 16:14 — forked from sit/import_dayone.py
Import various text files into DayOne without using the DayOne CLI.
#
# Usage: mkdir /tmp/export; find path -name *.html | xargs python
# import_dayone.py | tee /tmp/export.log
#
import datetime
import plistlib
import pytz
import uuid
import sys
@tgray
tgray / dontforget.bash
Created January 23, 2016 14:18 — forked from ttscoff/dontforget.bash
Quick reminders from Terminal (bash)
#!/bin/bash
# dontforget
#
# A stupid script for short term reminders in bash
#
# Arguments just need to contain a number and a bunch of words.
#
# The number can be anywhere in the arguments, but there shouldn't
# be any other numeric digits.
#
@tgray
tgray / flickr_up
Last active September 8, 2015 10:35
#!/usr/bin/env python
# !/usr/bin/python
from flickrapi import FlickrAPI
from os.path import basename, splitext
import sys, os
import argparse
import errno
import shutil
import mimetypes