This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# encoding: utf-8 | |
from __future__ import (absolute_import, division, print_function, | |
unicode_literals) | |
import glob | |
import gzip | |
import os | |
import re |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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', '*') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# encoding: utf-8 | |
"""Attempting to mop up Thomas XML | |
`pip install requests beautifulsoup4 html5lib lxml` | |
""" | |
from __future__ import (absolute_import, division, print_function, | |
unicode_literals) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"@context": "http://iiif.io/api/presentation/2/context.json", | |
"@id": "http://www.example.org/iiif/book1/manifest", | |
"@type": "sc:Manifest", | |
"attribution": "Provided by Example Organization", | |
"description": "A longer description of this example book. It should give some real information.", | |
"label": "Book 1", | |
"license": "http://www.example.org/license.html", | |
"logo": "http://www.example.org/logos/institution1.jpg", | |
"metadata": [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdarg.h> | |
#include <stdlib.h> | |
#include <float.h> | |
static int isNegative(float arg) { | |
char *p = (char*) malloc(20); | |
sprintf(p, "%f", arg); | |
return p[0] == '-'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Optimizing https://www.congress.gov/img/congress_gov_logo2.png | |
Original: 8654 | |
optipng: 8652 | |
advpng: 8216 | |
zopflipng: 8215 | |
Final: 8215 94.93% (439 bytes saved) | |
Optimizing https://congress.gov/img/sprite_congress.png | |
Original: 8137 | |
optipng: 6857 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Versions: | |
python : 2.7.1 | |
openpyxl : 2.2.5 | |
pyexcelerate: 0.6.6 | |
xlsxwriter : 0.7.3 | |
xlwt : 1.0.0 | |
Dimensions: | |
Rows = 10000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function ($) { | |
'use strict'; | |
/* Based on https://github.com/wikimedia/mediawiki-extensions-NavigationTiming/ */ | |
function recordTimeToFirstPaint() { | |
// Use Chrome's loadTimes or IE 9+'s msFirstPaint to record the time to render in milliseconds: | |
var firstPaintTime, timingSource; | |
if ('chrome' in window && $.isFunction(window.chrome.loadTimes)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<video id="player" itemprop="video" controls preload="auto" poster="http://content.wdl.org/536/thumbnail/1438262714/616x510.jpg"> | |
<source type="video/mp4" src="http://dl.wdl.org/536/service/536.mp4"> | |
<object id="videoPlayer" type="application/x-shockwave-flash" data="/static/swf/video/videoPlayer.706e405e7ad9.swf" width="320" height="278"> | |
<param name="movie" value="/static/swf/video/videoPlayer.706e405e7ad9.swf"> | |
<param name="flashvars" value="thisVideo=http://dl.wdl.org/536/service/536.flv&thisCC=&thisBg=http://content.wdl.org/536/thumbnail/1438262714/308x255.jpg"> | |
<param name="quality" value="best"> | |
<p class="text-danger">This item is currently unavailable in a format which may be viewed on your device</p> | |
</object> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env PYTHONIOENCODING=utf-8 python | |
# encoding: utf-8 | |
from __future__ import absolute_import, print_function, unicode_literals | |
import os | |
import re | |
import requests |