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
fun RepositoryHandler.enableMirror() { | |
all { | |
if (this is MavenArtifactRepository) { | |
val originalUrl = this.url.toString().removeSuffix("/") | |
urlMappings[originalUrl]?.let { | |
logger.lifecycle("Repository[$url] is mirrored to $it") | |
this.setUrl(it) | |
} | |
} | |
} |
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/env python3 | |
from typing import * | |
import sys | |
import os | |
import re | |
from pathlib import Path | |
def search_and_handle( | |
search_pattern: Union[AnyStr, Pattern], |
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 | |
SCRIPT_DIR="$(cd $(dirname "$0") && pwd -P)" | |
LOGSEQ_DIR="$(dirname "$SCRIPT_DIR")" | |
PY_SCRIPT="clear_unref_images.py" | |
"$SCRIPT_DIR/$PY_SCRIPT" "$LOGSEQ_DIR" -b | |
echo 'DONE' | |
read |
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
-- 确保所有操作只与关系表相关 | |
CREATE PROC add_directory(@dir_id bigint, @parent bigint) AS | |
BEGIN | |
INSERT INTO directory_relation (ancestor_id, member_id, distance) | |
SELECT ancestor_id, @dir_id, distance + 1 | |
FROM directory_relation | |
WHERE member_id = @parent | |
UNION ALL | |
SELECT @dir_id, @dir_id,0; |
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
/*Domain*/ | |
interface SimpleUser : Validatable { | |
val id: Long | |
val name: String | |
@JvmDefault | |
fun desc(): String = "$id:$name" | |
} | |
interface User : SimpleUser { |
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 javax.annotation.Nullable; | |
import java.util.Arrays; | |
import java.util.Collection; | |
import java.util.Map; | |
import java.util.Optional; | |
import java.util.function.BiConsumer; | |
import java.util.function.BiPredicate; | |
import java.util.function.Function; | |
import java.util.function.Supplier; | |
import java.util.stream.Collectors; |
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
package top.abosen.nameware; | |
import java.io.Serializable; | |
import java.lang.invoke.SerializedLambda; | |
import java.lang.reflect.Method; | |
import java.util.Arrays; | |
import java.util.Optional; | |
public class Main { |
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
package top.abosen.toys.ipv6; | |
import java.util.Comparator; | |
import java.util.List; | |
import java.util.concurrent.ThreadLocalRandom; | |
import java.util.function.Supplier; | |
import java.util.stream.Collectors; | |
import java.util.stream.IntStream; | |
/** |
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
package top.abosen.toys.ipv6.match; | |
import inet.ipaddr.IPAddress; | |
import inet.ipaddr.IPAddressString; | |
import java.util.ArrayList; | |
import java.util.Collections; | |
import java.util.List; | |
/** |
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 sun.misc.Contended; | |
import sun.misc.Unsafe; | |
import java.lang.reflect.Field; | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Executors; | |
import java.util.concurrent.TimeUnit; | |
import java.util.stream.IntStream; | |
class Scratch { |