Skip to content

Instantly share code, notes, and snippets.

View shiguruikai's full-sized avatar

shiguruikai shiguruikai

View GitHub Profile
@shiguruikai
shiguruikai / 5chBrowser.js
Last active May 16, 2023 12:36
Tampermonkey用の簡易5chブラウザ(NG設定、サムネイル表示)
// ==UserScript==
// @name 5ch Browser
// @namespace http://tampermonkey.net/
// @version 1.0.0
// @description 簡易5chブラウザ(NG設定、サムネイル表示)
// @author shiguruikai
// @match *://*.5ch.net/test/*
// @match *://*.5ch.sc/test/*
// @match *://*.bbspink.com/test/*
// @grant none
<?php
class EncryptionUtil
{
/**
* 文字列を暗号化して、Base64エンコードされた暗号文を返します。
* 暗号方式はAES-256-CBC、鍵導出関数はPBKDF2を使用します。次のコマンドと同様です。
*
* echo '$plaintext' | openssl aes-256-cbc -pbkdf2 -a -e -k '$password' -iter $iterations -md $digest_method
*
function diffc(
[Parameter(Mandatory)]
[string]
$FileA,
[Parameter(Mandatory)]
[string]
$FileB
) {
Write-Host "--- $(Convert-Path $FileA)"
Write-Host "+++ $(Convert-Path $FileB)"
function Format-Bytes {
[OutputType([string])]
[CmdletBinding()]
param (
[Parameter(Position = 0, Mandatory, ValueFromPipeline)]
[long] $Value,
[Parameter(Position = 1)]
[int] $DecimalPlaces = 1
)
if ($DecimalPlaces -lt 0) {
[OutputType([System.IO.FileSystemInfo])] # +Property(Bytes, HumanBytes)
[CmdletBinding(
DefaultParameterSetName = "Path"
)]
param (
[Parameter(
Position = 0,
ValueFromPipeline,
ParameterSetName = "FileSystemInfo")]
[ValidateNotNullOrEmpty()]
[CmdletBinding(DefaultParameterSetName = "default")]
param (
[Parameter(Mandatory = $true, Position = 0)]
[Parameter(ParameterSetName = "default")]
[alias("l")]
[string] $LeftPath,
[Parameter(Mandatory = $true, Position = 1)]
[Parameter(ParameterSetName = "default")]
[alias("r")]
import java.io.File;
import java.io.IOException;
import java.nio.file.FileVisitOption;
import java.nio.file.FileVisitResult;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.SimpleFileVisitor;
import java.nio.file.StandardOpenOption;
import java.nio.file.attribute.BasicFileAttributes;
import java.util.Objects;
import java.util.function.Supplier;
public final class Lazy<T> implements Supplier<T> {
private volatile Supplier<T> initializer;
private volatile T value;
private Lazy(Supplier<T> initializer) {
this.initializer = initializer;
import java.util.function.IntPredicate;
public final class StringUtils {
private StringUtils() {}
public static boolean isNullOrEmpty(String string) {
return string == null || string.isEmpty();
}
private static boolean isCamelCaseDelimiter(int c) {
import java.util.Arrays;
import java.util.Scanner;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.stream.Collectors;
import java.util.stream.Stream;
public class ParallelExecutor {
public static void main(String[] args) {