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
""" Converts quora dumps that you can request Quora to send you (multiple zip files) into parsed json and markdown | |
To use: | |
1. install dateparser, beautifulsoup4, markdownify | |
2. copy the zips you've received to ./data, make sure to keep only the ones containing answers (some will | |
contain comments, blog posts, and other metadata) | |
3. run this script | |
4. see ./output folder | |
License (MIT): | |
Copyright 2021 Yuan Gao |
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
/** A logger instance that can be used for writing log messages | |
* @param {String} _name The logger's name. This will appear in any log messages produced by this logger | |
* @param {Struct} _bound_values Optional struct of bound values which will be included in all log messages produced by this logger | |
* @param {Struct.Logger} _root_logger The loot logger instance that is this logger's parent | |
* @author Meseta https://meseta.dev | |
*/ | |
function Logger(_name="logger", _bound_values=undefined, _root_logger=undefined) constructor { | |
/* @ignore */ self.__name = _name; | |
/* @ignore */ self.__bound_values = (is_struct(_bound_values) ? _bound_values : {}); | |
/* @ignore */ self.__file_handle = -1; |
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
/** A min-heap implementation (i.e. priority queue). value-priority pairs can be inserted into the heap, which wil | |
* efficiently maintain sort order, and the minimum priorty value can be queried at any time | |
* @author Meseta https://meseta.dev | |
*/ | |
function MinHeap() constructor { | |
/* @ignore */ self.__values = []; // Heap-ordered storage. array of value/priority pairs, the zerth index is maintained to be lowest priority | |
/* @ignore */ self.__length = 0; | |
/** Returns how many elements are in the heap | |
* @return {Real} |
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
/** A max-heap implementation (i.e. priority queue). value-priority pairs can be inserted into the heap, which wil | |
* efficiently maintain sort order, and the maximum priorty value can be queried at any time | |
* @author Meseta https://meseta.dev | |
*/ | |
function MaxHeap() constructor { | |
/* @ignore */ self.__values = []; // Heap-ordered storage. array of value/priority pairs, the zerth index is maintained to be highest priority | |
/* @ignore */ self.__length = 0; | |
/** Returns how many elements are in the heap | |
* @return {Real} |
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
#!/bin/bash | |
echo "deb http://security.ubuntu.com/ubuntu xenial-security main" > /etc/apt/sources.list.d/xenial-security.list | |
apt-get update | |
apt-get install --no-install-recommends --yes \ | |
curl \ | |
gnupg \ | |
ca-certificates \ | |
build-essential \ |
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
/** Compresses a buffer using gzip (deflate) | |
* @param {Id.Buffer} _buffer The buffer to compress | |
* @param {Real} _offset the offset in buffer to start compressing | |
* @param {Real} _size the number of bytes to compress | |
* @return {ID.Buffer} | |
*/ | |
function buffer_compress_gzip(_buffer, _offset, _size) { | |
// Pre-calculated CRC table | |
static _crc_table = undefined; | |
if (is_undefined(_crc_table)) { |
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
#!/bin/bash | |
apt-get update | |
apt-get install --no-install-recommends --yes \ | |
curl \ | |
ca-certificates \ | |
gpg \ | |
gpg-agent \ | |
dirmngr |