Skip to content

Instantly share code, notes, and snippets.

View ZenLiuCN's full-sized avatar
🎯
Focusing

Zen Liu ZenLiuCN

🎯
Focusing
  • China Sichuan
View GitHub Profile
@ZenLiuCN
ZenLiuCN / JdkTips.java
Last active November 3, 2023 05:15
Java tips
interface JdkTips{
static void toClipboard(String val){
//java.awt.Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new java.awt.datatransfer.StringSelection($SELECTION$), null);
java.awt.Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new java.awt.datatransfer.StringSelection(val), null);
}
}
@ZenLiuCN
ZenLiuCN / attach_console.go
Created February 5, 2023 09:53
unit for attch to console with windows gui application
//go:build windows
/*
* written by Zen.Liu, License as MIT
*/
package main
import (
"os"
s "syscall"
)
@ZenLiuCN
ZenLiuCN / macro_log_unit.h
Last active February 3, 2023 08:22
C Units
//
// Created by ZenLiu, license MIT
//
#ifndef _MACRO_LOG_UNIT_H
#define _MACRO_LOG_UNIT_H
#ifdef MACRO_LOG_INTO_FILE
/**
* user's response to open and close file if defined _LOG_FILE_.
@ZenLiuCN
ZenLiuCN / PetiteVue_Template.html
Last active January 2, 2022 10:06
PetiteVue Modular Template
<html>
<head>
<title>template</title>
<style>
body {
font-family: Helvetica Neue, Arial, sans-serif;
}
</style>
</head>
<body>
@ZenLiuCN
ZenLiuCN / sample.go
Last active November 17, 2021 07:33 — forked from chanwit/win32_jit.go
package main
import (
"syscall"
"unsafe"
)
const (
MemCommit = 0x1000
MemReserve = 0x2000
PageExecuteReadwrite = 0x40

*unix

fetch process memory

ps -ux --sort rss  | awk 'NR>1 {$6=int(100 * $6/1024)/100"MB";$5=int(100 * $5/1024)/100"MB";}{ print;}'|column -t
public interface ClassSerialize{
static String classToString(Class cls) {
return cls.getName()
.replaceFirst("class ", "")
.replaceFirst("interface ", "");
}
@SneakyThrows
static Class stringToClass(String cls) {
if (cls.contains("$")) {
@ZenLiuCN
ZenLiuCN / docker_cheat.md
Last active July 19, 2021 05:40
DOCKER_CHEAT

Docker Cheat Tips

1. run deno inside docker

run deno inside docker

script or command to start :

#!/bin/sh
docker run --rm \
-a STDIN -a STDOUT -a STDERR \

Common Maven Config properties

File Encode

<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

Java Versions

<java.version>1.8</java.version>

1.8

package tester;
import io.protostuff.LinkedBuffer;
import io.protostuff.ProtostuffIOUtil;
import io.protostuff.Schema;
import io.protostuff.runtime.DefaultIdStrategy;
import io.protostuff.runtime.IdStrategy;
import io.protostuff.runtime.RuntimeSchema;
import lombok.SneakyThrows;
import lombok.ToString;