Skip to content

Instantly share code, notes, and snippets.

@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 / superstar.json
Created December 10, 2014 23:00
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 November 17, 2014 03:23
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).
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 November 17, 2014 03:22
Cleans the content of your current page and creates a new note in Evernote.
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 November 17, 2014 03:22
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.
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 November 17, 2014 03:21
Returns to 1Writer and replaces the selection with a Markdown link from the Safari page.
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 November 17, 2014 03:16
Opens the source code from the current page on Textastic
javascript:location.href=(function(){var href=location.href;return "textastic"+href.substring(href.indexOf("://"));})();
@philgruneich
philgruneich / cleanLinksRiposte.js
Created November 17, 2014 03:13
Sends URL to Clean Links and generates a Markdown link for Riposte
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 November 17, 2014 02:22
Send entire feed to Pinboard
#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 November 16, 2014 06:19
Open latest Draft article on either Byword or 1Writer
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))