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
# SPDX-FileCopyrightText: Copyright 2020-2024, Contributors | |
# SPDX-PackageHomePage: https://gist.github.com/dmyersturnbull | |
# SPDX-License-Identifier: Apache-2.0 | |
""" | |
Tool to diff two order-independent sets of lines. | |
""" | |
import math | |
import sys |
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
/** | |
* Recommended exit codes from {@code /usr/include/sysexits.h}. | |
*/ | |
public final class ExitStatus { | |
public static final int OK = 0; | |
public static final int GENERIC_ERROR = 1; | |
public static final int BASE = 64; | |
public static final int USAGE = 64; | |
public static final int NO_DATA = 65; | |
public static final int NO_INPUT = 66; |
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
*.backup | |
/data |
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
[metadata] | |
description-file = "README.md" | |
[build-system] | |
requires = ["poetry>=1.0", "coverage[toml]"] | |
build-backend = "poetry.masonry.api" | |
######################################################################################### | |
# Poetry 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
import argparse, sys, re, logging | |
from pathlib import Path | |
from typing import Mapping, Any, Sequence, Collection | |
from typing import Tuple as Tup | |
logger = logging.getLogger('paperpile-latex') | |
class Paperpiler: |
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
[ | |
{ | |
"code": "100", | |
"phrase": "Continue", | |
"description": "The initial part of a request has been received and has not yet been rejected by the server.", | |
"spec_title": "RFC7231#6.2.1", | |
"spec_href": "https://tools.ietf.org/html/rfc7231#section-6.2.1" | |
}, | |
{ | |
"code": "101", |
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
import sys | |
import re | |
from pathlib import Path | |
def fix(path: Path, accent_file: Path, output_path: Path) -> None: | |
""" | |
Reformat my bib file. | |
* Remove PMC and DOI URLs because they're listed as IDs anyway. | |
* Replace accent-like escape characters with their UTF equivalents. I mean, it's 2020. |
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
See https://github.com/dmyersturnbull/genomics-io/tree/master/core/src/main/java/org/pharmgkb/parsers/escape | |
package org.pharmgkb.parsers.escape; | |
import com.google.common.base.Preconditions; | |
import com.google.common.collect.ImmutableSet; | |
import javax.annotation.Nonnull; | |
import javax.annotation.concurrent.NotThreadSafe; | |
import javax.annotation.concurrent.ThreadSafe; |
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
// copied from https://github.com/dmyersturnbull/genomics-io/blob/master/core/src/main/java/org/pharmgkb/parsers/utils/HttpHeadResponse.java | |
package org.pharmgkb.parsers.utils; | |
import com.google.common.collect.ImmutableMap; | |
import javax.annotation.Nonnegative; | |
import javax.annotation.Nonnull; | |
import javax.annotation.concurrent.Immutable; | |
import java.io.IOException; | |
import java.net.HttpURLConnection; |
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
// copied from https://github.com/dmyersturnbull/genomics-io/blob/master/core/src/main/java/org/pharmgkb/parsers/utils/Try.java | |
package org.pharmgkb.parsers.utils; | |
import javax.annotation.Nonnull; | |
import javax.annotation.Nullable; | |
import java.util.Objects; | |
import java.util.Optional; | |
import java.util.function.Function; | |
import java.util.function.Supplier; |
NewerOlder