Skip to content

Instantly share code, notes, and snippets.

@judell
judell / trello.py
Created August 13, 2015 00:02
trello / github
import requests, json, re
backlog_triage_list = '55c39b276b173fdfaef897f1'
backlog_not_prioritized_list = '55a3fb6903a766588973e8c5'
backlog_backlog_list = '55796ed5c0e8c6a2f25dba6e'
sprint_up_next = '557936eed7f9bf6d2dd1521e'
sprint_in_progress = '5578c7a3f955667e94879086'
sprint_deployed = '555cab97ea82d6a4151b7f92'
sprint_delivered = '555cb1ea055301c6f20e50df'
# File "E:\Lib\urllib.py", line 1577, in getproxies_registry
# proxyEnable = _winreg.QueryValueEx(internetSettings,
# IOError: System.IO.IOException: The specified registry key does not exist.
elif os.name == 'nt':
def getproxies_registry():
"""Return a dictionary of scheme -> proxy server URL mappings.
Win32 uses the registry to store proxies.
@judell
judell / gist:69362cd81b16e24c4624
Created September 25, 2015 21:34
2015-09-25 testing narrative: initial db state for test url
{
"rows": [
{
"updated": "2015-06-15T21:31:28.144726+00:00",
"group": "__world__",
"target": [
{
"scope": [
"http://blog.jonudell.net"
],
@judell
judell / rrid.py
Created November 23, 2015 16:37
rrid annotation
import json, requests, re, traceback, pyramid, urlparse
from lxml import etree
try:
from urllib.parse import urlencode
except ImportError:
from urllib import urlencode
host = 'h.jonudell.info' # or your own
port = 8081
host_port = 'http://' + host + ':' + str(port)
{
"total": 1,
"rows": [
{
"permissions": {
"update": [
"acct:judell@hypothes.is"
],
"read": [
"group:__world__"
Tracing route to mscomajax.vo.msecnd.net [70.37.129.147]
over a maximum of 30 hops:
1 1 ms 1 ms 1 ms base2.ne.rr.com [192.168.1.1]
2 * * * Request timed out.
3 * 7 ms 7 ms rdc-24-31-154-6.ne.east.twcable.com [24.31.154.6]
4 15 ms 12 ms 11 ms g10-5-1-0.ptldmehx-rtr001.ne.northeast.rr.com [204.210.69.230]
5 33 ms 40 ms 30 ms rdc-204-210-69-49.ne.northeast.rr.com [204.210.69.49]
6 34 ms 31 ms 31 ms ae-5-0.cr0.nyc30.tbone.rr.com [66.109.6.74]
{
"target": [{
"scope": ["http://www.jneurosci.org/content/35/20/7777.full"],
"selector": [{
"exact": "nif-0000-30467",
"prefix": "f Health; ",
"type": "TextQuoteSelector",
"suffix": ") and lesio"
}]
}],
@judell
judell / wikipedia articles with public annotations
Last active April 20, 2016 17:41
annotated wikipedia urls as of 4/12/2016
http://ar.wikipedia.org/wiki/%D9%85%D8%AD%D9%85%D8%AF_%D9%85%D8%B1%D8%B3%D9%8A
http://arstechnica.com/staff/2015/12/editorial-wikipedia-fails-as-an-encyclopedia-to-sciences-detriment/
http://de.wikipedia.org/w/index.php?title=Hermann_Ostfeld&redirect=no
http://de.wikipedia.org/wiki/Abraham_Horodisch
http://de.wikipedia.org/wiki/Adolf_Wohlwill
http://de.wikipedia.org/wiki/Alphonse_Levy
http://de.wikipedia.org/wiki/Arno_Nadel
http://de.wikipedia.org/wiki/Arthur_Ruppin
http://de.wikipedia.org/wiki/Bruno_Strauss
http://de.wikipedia.org/wiki/Clara_Anschel
{
"rows": [
{
"updated": "2016-08-15T23:45:54.379082+00:00",
"group": "__world__",
"target": [
{
"source": "https://www.theguardian.com/environment/2016/aug/02/environment-climate-change-records-broken-international-report",
"selector": [
{
def url_transfer_row(id=None, url_dest=None, username=None, token=None):
h = Hypothesis(username=username, token=token)
row = h.get_annotation(id)
try:
row['user'] = 'acct:' + h.username + '@hypothes.is'
permissions = row['permissions']
permission_fields = ['admin','update','delete']
for field in permission_fields:
permissions[field][0] = 'acct:' + h.username + '@hypothes.is'
row['permissions'] = permissions