Skip to content

Instantly share code, notes, and snippets.

@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
View superstar.json
"superstar_avg": {
"skill_modifiers": {
"punt_power": {
"cost": -0.2,
"max": 10
},
"tackle_awareness": {
"cost": -0.2,
"max": 10
},
@philgruneich
philgruneich / openOnTweetbotRiposte.js
Created Nov 17, 2014
Grabs username from App.net or Twitter profile on Safari, prompts on Launch Center Pro for action and triggers the chosen app: [Tweetbot](https://itunes.apple.com/us/app/tweetbot-3-for-twitter.-elegant/id722294701?mt=8&uo=4&at=10l4KL) or [Riposte](https://itunes.apple.com/us/app/riposte-for-app.net/id592316697?mt=8&uo=4&at=10l4KL).
View openOnTweetbotRiposte.js
javascript:window.location='launchpro://?url='+encodeURIComponent('[list:Open '+location.pathname.substring(1)+'|Mention on Tweetbot=tweetbot:///post?text=%40|Open on Tweetbot=tweetbot:///user_profile/|Mention on Riposte=riposte://x-callback-url/createNewPost?text=%40]'+location.pathname.substring(1))
@philgruneich
philgruneich / evernoteWebclipper.js
Created Nov 17, 2014
Cleans the content of your current page and creates a new note in Evernote.
View evernoteWebclipper.js
javascript:(function(){var request=new XMLHttpRequest();request.open("GET","http://heckyesmarkdown.com/go/?read=1&md=0&preview=0&showframe=0&output=url&u="+encodeURIComponent(location.href),true);request.send();request.onreadystatechange=function(){location.href="evernote://x-callback-url/new-note?type=html&title="+encodeURIComponent(window.document.title)+"&text="+request.responseText};})();
@philgruneich
philgruneich / evernoteWebclipperDrafts.js
Created Nov 17, 2014
Cleans the content of your current page and sends it to Drafts, which creates a new note in Evernote and includes geolocation. Requires the Markdown to Evernote action.
View evernoteWebclipperDrafts.js
javascript:(function(){var request=new XMLHttpRequest();request.open("GET","http://heckyesmarkdown.com/go/?read=1&preview=0&showframe=0&output=url&u="+encodeURIComponent(location.href),true);request.send();request.onreadystatechange=function(){location.href="drafts4://x-callback-url/runAction?text="+encodeURIComponent(window.document.title + "\n")+request.responseText+"&action=Markdown To Evernote"};})();
@philgruneich
philgruneich / return1Writer.js
Created Nov 17, 2014
Returns to 1Writer and replaces the selection with a Markdown link from the Safari page.
View return1Writer.js
javascript:window.location='onewriter://x-callback-url/replace-selection?text='+encodeURIComponent('%5B%5D('+location.href+'%20%5C''+document.title+'%5C')')
@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("://"));})();
@philgruneich
philgruneich / cleanLinksRiposte.js
Created Nov 17, 2014
Sends URL to Clean Links and generates a Markdown link for Riposte
View cleanLinksRiposte.js
javascript:window.location='clean-links://x-callback-url/clean?url='+encodeURIComponent(location.href)+'&x-success='+encodeURIComponent('drafts4://x-callback-url/runAction?text='+encodeURIComponent('['+document.title+'](||clipboard||)')+'&action=Send%2520to%2520Riposte&afterSuccess=Delete')
@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 / latest_draft.py
Created Nov 16, 2014
Open latest Draft article on either Byword or 1Writer
View latest_draft.py
from requests import get
from json import loads
from urllib import quote
from webbrowser import open
email = 'YOUR EMAIL'
password = 'YOUR PASSWORD'
r = get('https://draftin.com/api/v1/documents.json', auth=(email,password))