Skip to content

Instantly share code, notes, and snippets.

@jakl
Last active December 17, 2015 23:29
Show Gist options
  • Save jakl/5689738 to your computer and use it in GitHub Desktop.
Save jakl/5689738 to your computer and use it in GitHub Desktop.
gunzip
(function(exports){
fetchGzipped = function(url, cb){
var req = new XMLHttpRequest()
req.open('GET', url, true)
req.responseType = 'arraybuffer'
req.onload = function(){
gzdata = new Uint8Array(req.response)
data = (new Zlib.Gunzip(gzdata)).decompress()
var f = new FileReader()
f.onload = function(e) {
cb(e.target.result)
}
f.readAsText(new Blob([data]))
}
req.send()
}
exports.fetch = function(volume, ready){
if(volume === 'science_and_health')
fetchGzipped(
'https://dl.dropboxusercontent.com/s/pdw305sr6nwv1bo/science_and_health.gzip?token_hash=AAG7mZT4f8DYxXsXwn9mGyiG4s9mIrIwftCVMC54ij7soA&dl=1'
, function(text){
exports.science_and_health = text
ready();
}
)
}
})(typeof exports === 'undefined' ? this['cskit']={} : exports)
This file has been truncated, but you can view the full file.
View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment