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 java.io.FileInputStream; | |
import java.io.FileOutputStream; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.OutputStream; | |
import java.util.zip.Deflater; | |
import java.util.zip.DeflaterOutputStream; | |
public class ZlibNgTest { | |
public static void main(String[] args) { |
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 java.util.Arrays; | |
import java.util.List; | |
class Test { | |
public static TestClassNoSuper tcns; | |
public static TestClassExtendsBar tceb; | |
public static class Foo {} | |
public static class Bar { | |
static { | |
System.out.println("Bar initialiser..."); | |
if (tcns != null) { |
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 glob | |
import os | |
import sys | |
import tempfile | |
import zipfile | |
classname_str, *search_dirs = sys.argv[1:] | |
classname_bytes = classname_str.encode() | |
for search_dir in search_dirs: |
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 java.io.BufferedInputStream; | |
import java.io.BufferedReader; | |
import java.io.FileInputStream; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.InputStreamReader; | |
import java.io.Reader; | |
import java.math.BigInteger; | |
import java.nio.charset.StandardCharsets; |
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/python3 | |
import struct | |
import sys | |
import zipfile | |
zfile, entry = sys.argv[1:] | |
with zipfile.ZipFile(zfile) as zf: | |
info = zf.getinfo(entry) | |
with open(zfile, "rb") as fh: |
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/python3 | |
import json | |
import zipfile | |
from hashlib import sha1, sha256 | |
from asn1crypto import cms # type: ignore[import-untyped] | |
from cryptography.exceptions import InvalidSignature | |
from cryptography.hazmat.primitives import serialization |
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 | |
set -euo pipefail | |
zipentry=META-INF/version-control-info.textproto | |
commit_from_zip() { | |
unzip -p -- "$1" "$zipentry" | grep revision | grep -Eo '[0-9a-f]+' | tail -1 | |
} | |
url="${1:-}" | |
if [ -z "$url" ]; then | |
read -r -p 'url> ' | |
url="$REPLY" |
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
public class Unicode { | |
public static void main(String[] args) { | |
String foo = "🏳️⚧️"; | |
for (String x : foo.split("")) { | |
System.out.println(x.codePointAt(0)); | |
} | |
System.out.println("---"); | |
int n = foo.codePointCount(0, foo.length()); | |
for (int i = 0; i < n; ++i) { | |
int j = foo.offsetByCodePoints(0, i); |
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
[flake8] | |
ignore = E501 |
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/python3 | |
# encoding: utf-8 | |
# SPDX-FileCopyrightText: 2024 FC (Fay) Stegerman <flx@obfusk.net> | |
# SPDX-License-Identifier: GPL-3.0-or-later | |
import os | |
import struct | |
import zipfile | |
from dataclasses import dataclass |
NewerOlder