Skip to content

Instantly share code, notes, and snippets.

@philgruneich
philgruneich / Complete Reminder.py
Created March 20, 2016 18:56 — forked from anonymous/Complete Reminder.py
Complete Reminder.py
# coding: utf-8
import reminders
import sys
import dialogs
import webbrowser
from urllib import quote
def completeReminder():
@philgruneich
philgruneich / FixMovieDiary.py
Created February 20, 2016 23:01 — forked from anonymous/FixMovieDiary.py
FixMovieDiary.py
# coding: utf-8
import keychain
import console
from urllib import quote, unquote
keychain.set_password('MovieDB', 'API', console.input_alert('Insert your MovieDB API key', '', keychain.get_password('MovieDB', 'API')))
keychain.set_password('Airtable', 'API', console.input_alert('Insert your Airtable API key', '', keychain.get_password('Airtable', 'API')))
keychain.set_password('Airtable', 'Movie Diary', console.input_alert('Insert your Airtable database ID', '', keychain.get_password('Airtable', 'Movie Diary')))
keychain.set_password('Airtable', 'Movie Diary Table', quote(console.input_alert('Insert the name of your Airtable table', '', unquote(keychain.get_password('Airtable', 'Movie Diary Table')))))
@philgruneich
philgruneich / commas_mmdtable.py
Last active March 18, 2018 13:17
Scripts to simplify the syntax for MultiMarkdown tables.
import re
table = '''First Header,Second Header,Third Header
1st Item,2nd\,Item,3rd Item
,One cell,Two cells
Two cells,One cell,
Awesome'''
ttable = [[re.sub('\\\,',',',cell) for cell in re.split('(?<!\\\),', row)] for row in table.split('\n')]
@philgruneich
philgruneich / Movie Diary.py
Last active January 18, 2019 06:37 — forked from anonymous/Movie Diary.py
Movie Diary.py
#!/usr/bin/env/python2
# coding: utf-8
import requests
import json
import appex
import dialogs
import re
import datetime
import keychain
@philgruneich
philgruneich / diff_db.py
Created November 16, 2014 05:54
Show differences between 2 Dropbox files
# -*- coding: utf-8 -*-
import difflib
import re
import BaseHTTPServer
import webbrowser
header = '''<!DOCTYPE html>
<html>
<head>

Keybase proof

I hereby claim:

  • I am philgruneich on github.
  • I am philgruneich (https://keybase.io/philgruneich) on keybase.
  • I have a public key ASCImpS5AkiYRlekKl0e5xDWhf7uKDFxUjYlcA7aBcsOEQo

To claim this, I am signing this object:

@philgruneich
philgruneich / OCRtoInteract.py
Last active March 17, 2020 00:28
Requires Pythonista for iOS and Interact for iOS. Sends image and returns OCR'd text. Opens text in Interact unless used from action extension, then adds to clipboard.
# coding: utf-8
import requests
import photos
from PIL import Image, ImageEnhance
import StringIO
import appex
import console
import json
import keychain
@philgruneich
philgruneich / pythonUnread.py
Last active May 8, 2020 05:56
Fetches Pinboard for unread bookmarks and stores them in a JSON file.
#!/usr/local/bin/python3
import requests
import json
# User Configuration
PB_USERNAME = "your Pinboard username"
PB_PASSWORD = "your Pinboard password"
PB_PATH = "/absolute/path/to/file/PinboardUnread.json"
# End Configuration
@philgruneich
philgruneich / UpdatePinboardTags.py
Last active July 14, 2020 16:13
UpdatePinboardTags
#coding: utf-8
import console
import keychain
import pickle
login = keychain.get_password('pinboard.in','pythonista')
if login is not None:
user, pw = pickle.loads(login)
else:
from webbrowser import open
from urllib import quote
query = sys.argv[1]
#Web Services
stackoverflow = '!s '
wikipedia = '!w '
macupdate = '!mac '
appshopper = '!app '