Skip to content

Instantly share code, notes, and snippets.

@philgruneich
philgruneich / sourceCodeTextastic.js
Created Nov 17, 2014
Opens the source code from the current page on Textastic
View sourceCodeTextastic.js
javascript:location.href=(function(){var href=location.href;return "textastic"+href.substring(href.indexOf("://"));})();
View BangSearch.py
from webbrowser import open
from urllib import quote
query = sys.argv[1]
#Web Services
stackoverflow = '!s '
wikipedia = '!w '
macupdate = '!mac '
appshopper = '!app '
@philgruneich
philgruneich / New from Gist.py
Created Jan 30, 2016
Adds Python gists to Pythonista.
View New from Gist.py
# coding: utf-8
# This script downloads and opens a Gist from a URL in the clipboard.
# It's meant to be put in the editor's actions menu.
#
# It works with "raw" and "web" gist URLs, but not with gists that
# contain multiple files or non-Python files.
#
# If a file already exists, a dialog is shown that asks whether the
# new file should be renamed or replaced.
View UpdatePinboardTags.py
#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:
@philgruneich
philgruneich / sendFeedToPinboard.py
Created Nov 17, 2014
Send entire feed to Pinboard
View sendFeedToPinboard.py
#coding: utf-8
import feedparser
import urllib
import bs4
import keychain
import console
import pickle
# Get your token at:
# http://pinboard.in/settings/password
@philgruneich
philgruneich / pythonUnread.py
Last active May 8, 2020
Fetches Pinboard for unread bookmarks and stores them in a JSON file.
View pythonUnread.py
#!/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 / OCRtoInteract.py
Last active Mar 17, 2020
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.
View OCRtoInteract.py
# coding: utf-8
import requests
import photos
from PIL import Image, ImageEnhance
import StringIO
import appex
import console
import json
import keychain
View keybase.md

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 / tumblr.js
Created May 13, 2015
Open in Tumblr App
View tumblr.js
javascript:(function() {var tumblr=document.querySelector("meta[name='twitter:app:url:iphone']").getAttribute('content');if (tumblr.match(/^tumblr:\/\/x-callback-url\/blog\?.*/)) window.location=tumblr;})();
@philgruneich
philgruneich / diff_db.py
Created Nov 16, 2014
Show differences between 2 Dropbox files
View diff_db.py
# -*- coding: utf-8 -*-
import difflib
import re
import BaseHTTPServer
import webbrowser
header = '''<!DOCTYPE html>
<html>
<head>