Skip to content

Instantly share code, notes, and snippets.

# 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.
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]
@judell
judell / gist:9744381
Last active August 29, 2015 13:57
draft of CouchDB adaptor for TiddlyWiki
/*\
title: $:/plugins/tiddlywiki/tiddlyweb/tiddlywebadaptor.js
type: application/javascript
module-type: syncadaptor
A sync adaptor module for synchronising with Couch compatible servers
\*/
(function () {
@judell
judell / gist:632cc730c689e1c3572a
Created January 7, 2015 03:13
first step towards a wiki page inspector
(function() {
function getParas($item) {
debugger;
var s = '';
var href = $item.parent('.story').prev('.header').find('a').attr('href')
var id = href.match(/[^\/]+$/)[0];
var paras = $('#' + id).find('.paragraph p');
for ( var i = 0; i < paras.length; i++ ) {
var p = paras[i].innerText.substr(0,50) + ' ...';
{
"total": 1,
"rows": [
{
"permissions": {
"update": [
"acct:judell@hypothes.is"
],
"read": [
"group:__world__"
@judell
judell / gist:bd5c2a6374dba27338e4
Created March 27, 2015 19:29
h query syntax discussion
11:58:31 AM judell nickstenn: thoughts on h/issues/2095 re: 1) syntax normalization across /stream and /api, 2) behavior normalization (search works differently)
11:59:11 AM nickstenn h#2095
11:59:12 AM vannevar Normalize URL syntax and query behavior across /api and /stream: https://github.com/hypothesis/h/issues/2095
11:59:23 AM GitHub64 joined the channel.
11:59:23 AM -GitHub64- [h] nickstenning force-pushed 1916-stream-cards from 1862529 to fe5cd6c: https://github.com/hypothesis/h/commits/1916-stream-cards
11:59:23 AM -GitHub64- h/1916-stream-cards fe5cd6c Gergely Ujvari: Fix controller tests
11:59:23 AM GitHub64 left the channel.
11:59:49 AM tilgovi judell: I'd like to see that come as a natural consequence of unifying those code paths completely
12:00:15 PM tilgovi there's some interesting query parsing stuff going on, client and server, that can likely be vastly simplified
12:00:35 PM judell so now it's split between python and js?
@judell
judell / gist:4e074a239ac3aacdeb3d
Last active February 18, 2018 20:50
h bookmarklet to auto-open frame
//javascript:(function(){window.hypothesisConfig=function(){return{showHighlights:true};};var d=document,s=d.createElement('script');s.setAttribute('src','https://hypothes.is/app/embed.js');d.body.appendChild(s);var timer = setInterval(function(){if (window.annotator){window.annotator.showFrame();clearInterval(timer);}},300;})();
javascript: (function() {
window.hypothesisConfig = function() {
return {
showHighlights: true
};
};
var d = document,
s = d.createElement('script');
@judell
judell / gist:7b2dbb1e2d9dcae4eb65
Created March 30, 2015 18:30
h docs minus sphinx directives

HTTP API

This document details the h application's public HTTP API. It is targeted at developers interested in integrating functionality from Hypothesis into their own applications.

root

@judell
judell / gist:3942738dd584e239f091
Created March 31, 2015 13:20
H utils: 1, simple dashboard (users and annotations per day), 2. Atom feed synthesizer for H tag query
import json, urllib2
from feedgen.feed import FeedGenerator
from BaseHTTPServer import BaseHTTPRequestHandler
import urlparse, operator
class GetHandler(BaseHTTPRequestHandler):
def do_GET(self):
if not "method=" in self.path:
Stream:
https://hypothes.is/stream?q=uri:http:%2F%2Farstechnica.com%2Fgaming%2F2015%2F04%2Fvalve-software-co-founder-gabe-newell-becomes-a-video-game-character%2F
Found one result. Clear search.
Sorted by newest
Newest
Oldest
judell on “Valve Software co-founder Gabe…” (arstechnica.com) an hour ago
Valve Software co-founder Gabe Newell becomes a video game character