Skip to content

Instantly share code, notes, and snippets.

View syhily's full-sized avatar

Yufan Sheng syhily

View GitHub Profile
@syhily
syhily / build-protoc.sh
Created January 21, 2021 09:54
Build protoc.exe for Apple M1
#!/bin/bash
# Builds protoc executable into target/<OS>/<ARCH>/protoc.exe; optionally builds
# protoc plugins into target/<OS>/<ARCH>/protoc-gen-*.exe
#
# Usage: ./build-protoc.sh <OS> <ARCH> <TARGET>
#
# <TARGET> can be "protoc" or "protoc-gen-javalite". Supported <OS> <ARCH>
# combinations:
# HOST <OS> <ARCH> <COMMENT>
@syhily
syhily / ThunderPlugInsDeleter-macOS.sh
Created January 15, 2021 01:10
这段脚本可以让macOS上迅雷的外观更加简洁
cd /Applications/Thunder.app/Contents/PlugIns
rm -rf featuredpage.* advertising.* xlbrowser.* activitycenter.* xlplayer.* xiazaibao.* iOSThunder.* searchtask.* lixianspace.* softmanager.* webgame.* livestream.*
package json
import (
"bytes"
"fmt"
"io"
"net/http"
"strings"
"github.com/gin-gonic/gin/binding"
package main
import (
"fmt"
"math/rand"
"time"
)
const (
width = 80
-Xms128m
-Xmx2048m
-Xss256k
-XX:+UseG1GC
-XX:InitiatingHeapOccupancyPercent=65
-XX:G1HeapRegionSize=2
-XX:MaxGCPauseMillis=100
-XX:ReservedCodeCacheSize=240m
-XX:SoftRefLRUPolicyMSPerMB=50
-ea
import org.junit.jupiter.api.DisplayNameGenerator;
import java.lang.reflect.Method;
import static java.lang.Character.isDigit;
import static java.lang.Character.isLetterOrDigit;
import static java.lang.Character.isUpperCase;
/**
* Change the camelcase or underscore method name into a readable display name
#!/bin/sh
# Read the update version for this wiki.js
if [ $# -lt 1 ]
then
echo "Usage: $0 [wiki.js release version]"
echo "Example: $0 2.0.1"
exit 1
fi
@syhily
syhily / CamelCastDisplayNameGenerator.java
Last active January 3, 2019 08:33
A JUnit 5 display name generator for JUnit 5.4 or above.
import org.junit.jupiter.api.DisplayNameGenerator;
import java.lang.reflect.Method;
import static java.lang.Character.*;
/**
* Change the camelcase or underscore method name into a readable display name
*
* @author せいうはん (Employee ID: 17092068)
import org.apache.flink.api.common.state.MapStateDescriptor
import org.apache.flink.streaming.api.datastream.BroadcastStream
import org.apache.flink.streaming.api.functions.co.{CoFlatMapFunction, KeyedBroadcastProcessFunction}
import org.apache.flink.streaming.api.scala.{DataStream, StreamExecutionEnvironment, _}
import org.apache.flink.util.Collector
/**
* Joining and matching rules
*
* @author せいうはん (Employee ID: 17092068)
import org.junit.contrib.java.lang.system.internal.CheckExitCalled;
import org.junit.contrib.java.lang.system.internal.NoExitSecurityManager;
import org.junit.jupiter.api.extension.*;
import org.junit.jupiter.api.extension.ExtensionContext.Namespace;
import org.junit.jupiter.api.extension.ExtensionContext.Store;
import org.junit.platform.commons.support.ReflectionSupport;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;