Skip to content

Instantly share code, notes, and snippets.

View acdha's full-sized avatar

Chris Adams acdha

View GitHub Profile
@acdha
acdha / WDL links on Wikipedia which are HTTPS ready
Last active January 13, 2016 16:59
Links to wdl.org from the top 36 Wikipedia properties
@acdha
acdha / iiif-ar.po
Last active December 18, 2015 15:52
Translations for “IIIF Manifest” used on www.wdl.org contributed back to the IIIF community
"POT-Creation-Date: 2015-12-09 15:27+0000\n"
"PO-Revision-Date: 2015-11-26 00:54+0000\n"
"Language: ar\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 "
"&& n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n"
msgid "IIIF Manifest"
#!/usr/bin/env python3
# encoding: utf-8
"""Lorem ipsum dolor sit amet
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et
dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat
nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit
anim id est laborum.
@acdha
acdha / gist:fcf02c1c6adb127ba557
Created November 27, 2015 18:29
Dropbox 3.10.11 crash on OS X 10.11.1 while importing device photos
11/27/15 1:22:46.215 PM Dropbox[26351]: Dropbox(26351,0xa3778000) malloc: *** mach_vm_map(size=4198400) failed (error code=3)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
11/27/15 1:22:46.253 PM Dropbox[26351]: 70 Dropbox 0x00001868 start + 40
69 Dropbox 0x0000193d start + 253
68 Dropbox 0x00002093 main + 1427
67 Dropbox 0x00004264 main + 10084
66 Python 0x046db158 PyRun_SimpleFile + 40
65 Python 0x046d9753 PyRun_SimpleFileExFlags + 755
64 Python 0x046b2ee7 PyEval_EvalCode + 87
Opening https://authorities.loc.gov/ (0 remaining)
💻 DOMContentLoaded 0.145s
💻 load 0.489s
✅ https://authorities.loc.gov/
… done!
Opening https://catalog.loc.gov/ (0 remaining)
💻 DOMContentLoaded 0.079s
💻 load 0.362s
✅ https://catalog.loc.gov/
… done!
http://catalog2.loc.gov/cgi-bin/Pwebrecon.cgi?DB=local&BBID=18724967&v3=1
http://catalog2.loc.gov/cgi-bin/Pwebrecon.cgi?DB=local&PAGE=First
http://chroniclingamerica.loc.gov/
http://findingaids.loc.gov/
http://read.gov/
http://www.copyright.gov/
http://www.loc.gov/
http://www.loc.gov/about/office-of-the-inspector-general/
http://www.loc.gov/accessibility/
http://www.loc.gov/accessibility/web-site-accessibility/
Crawling https://www.usa.gov/
✅ https://www.usa.gov/
Crawling https://www.read.gov/cfb/
❌ https://www.read.gov/cfb/
Crawling https://www.read.gov/
❌ https://www.read.gov/
Crawling https://www.loc.gov/websites/
✅ https://www.loc.gov/websites/
Crawling https://www.loc.gov/vets/
✅ https://www.loc.gov/vets/
@acdha
acdha / LibraryOfCongress.xml
Last active October 8, 2015 14:38
HTTPS Everywhere ruleset for Library of Congress properties which support HTTPS. Open your profile folder (In Firefox, Help ➡️ Troubleshooting Information has a button) and add this file to the “HTTPSEverywhereUserRules” folder
<?xml version="1.0"?>
<ruleset name="LibraryOfCongress">
<target host="loc.gov"/>
<target host="www.loc.gov"/>
<target host="congress.gov"/>
<target host="memory.loc.gov"/>
<target host="lcweb2.loc.gov"/>
<target host="catalog.loc.gov"/>
<target host="catalog2.loc.gov"/>
<target host="cdn.loc.gov"/>
@acdha
acdha / simple_cors_server.py
Last active May 3, 2024 22:08
Python 3: serve the current directory as HTTP while setting CORS headers for XHR debugging
#!/usr/bin/env python3
# encoding: utf-8
"""Use instead of `python3 -m http.server` when you need CORS"""
from http.server import HTTPServer, SimpleHTTPRequestHandler
class CORSRequestHandler(SimpleHTTPRequestHandler):
def end_headers(self):
self.send_header('Access-Control-Allow-Origin', '*')