Skip to content

Instantly share code, notes, and snippets.

View honwhy's full-sized avatar
💭
I may be slow to respond.

Honwhy Wang honwhy

💭
I may be slow to respond.
View GitHub Profile
@honwhy
honwhy / vue-crypto-js.html
Created January 1, 2020 14:29
vue-crypto-js.html
<!DOCTYPE html>
<head>
<meta charset="UTF-8">
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
</body>
<div id="app">
<textarea v-model="input">
</textarea>
@honwhy
honwhy / MyFTP.java
Created January 12, 2020 08:13
用nio写ftpclient(未完)
package org.example;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.SocketException;
import java.nio.ByteBuffer;
import java.nio.channels.SelectionKey;
import java.nio.channels.Selector;
import java.nio.channels.SocketChannel;
import java.util.ArrayList;
@honwhy
honwhy / AnnotatedMap.java
Created June 12, 2022 09:23
copy Annotation to Map
package com.example.br;
import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.Map;
@MyTable("t_table")
public class AnnotatedMap<K, V> extends HashMap<K,V> {
public AnnotatedMap() {
@honwhy
honwhy / App.java
Created December 31, 2022 16:12
Java 8 CompletableFuture Suggestions
package org.example;
import java.util.*;
import java.util.concurrent.*;
/**
* Hello world!
*/
public class App {
static BlockingQueue<Runnable> blockingQueue = new ArrayBlockingQueue<>(200);
@honwhy
honwhy / TrieTreeNode.java
Last active January 16, 2023 14:28
TrieTreeNode v2
package org.example;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.Set;
public class TrieTreeNode {
private char ch;
private Set<Long> ids = new HashSet<>();
LinkedHashMap<Character, TrieTreeNode> children = new LinkedHashMap<>();
@honwhy
honwhy / after-build.md
Created September 15, 2024 04:14
你是一位资深Nodejs开发工程师,请写一段代码将zip压缩包里面的server/index.js文件内容替换为新的内容。

作为Node.js开发方面具有专业知识的工程师,我可以提供一个示例代码段,展示如何替换zip压缩包中的特定文件内容。你需要使用Node.js的adm-zip库来处理zip文件。以下是一个示例实现:

在Node.js中,你可以使用adm-zip库来处理ZIP文件的读取、修改和写入。以下是一个示例代码,展示了如何读取一个ZIP文件,替换其中的server/index.js文件内容,并保存更改。

首先,你需要安装adm-zip库:

npm install adm-zip