This file contains hidden or 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
\NeedsTeXFormat{LaTeX2e}[1999/12/01] | |
\ProvidesPackage{LaTeXSetup}[2020/01/16 LaTeX helpers] | |
% Hyphenation | |
% - hyphen sign, no others in this word (hy-phenation > hy-|phenation) | |
% "= hypen sign that allows other breaks (h"=yphenation > h-|y|phen|a|tion) | |
% "~ hyphen sign without line break (hy"~phenation > hy-phenation) | |
% \- possible hyphenation with sign (h\-yphenation > h|y|phen|a|tion) | |
% "" possible hyphenation without sign ((super"~)""hyphenation > (super-)*hy|pen|a|tion) | |
% "| break ligature and allow hyphenation |
This file contains hidden or 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 php | |
<?php | |
// Assuming gz content is plain text file and gzip file is concatenated | |
register_shutdown_function(function() { echo PHP_EOL; }); | |
// Limit access to cli | |
if (PHP_SAPI !== 'cli') die('This is a console application.'); | |
if ($_SERVER['argc'] < 2) die('Invalid number of arguments. Please provide input file.'); |
This file contains hidden or 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
<?php | |
declare(strict_types=1); | |
/** | |
* https://gist.github.com/fox34/2503bc11cfc1f1001a919ac655e48706 | |
* | |
* Multiple gzip files can simply be concatenated. This function tries to extract the last chunk of a concatenated gzip file. | |
* Works by searching for the magic number 1f 8b | |
* Poor performance because of backtracking and multiple re-reads |