Skip to content

Instantly share code, notes, and snippets.

View syhily's full-sized avatar
🎯
Focusing

Yufan Sheng syhily

🎯
Focusing
View GitHub Profile
@syhily
syhily / idea64.vmoptions
Created November 27, 2017 08:08
IDEA JVM Optimize
-ea
-server
-Xms1G
-Xmx2048M
-Xss2m
-XX:MaxMetaspaceSize=1G
-XX:ReservedCodeCacheSize=512m
-XX:MetaspaceSize=512m
-XX:+UseConcMarkSweepGC
-XX:+DoEscapeAnalysis
@syhily
syhily / alert-consumer-conf.sh
Last active May 6, 2019 10:34
Spring Boot Bootstrap Shell
#!/usr/bin/env bash
PID_FILE="consumer.pid"
PID_FILE_STORE_PATH=""
MAIN_CLASS="com.oneapm.touch.alert.consumer.Consumer"
function ensure_pid_path() {
if [ "x$PID_FILE_STORE_PATH" = "x" ]; then
# Default PID path in bin path
PID_FILE_STORE_PATH="${BASE_DIR}/bin"
object Count extends App {
def sliceFromMaxElement(array: Array[Int]) = {
val (left, right) = array.span(_ < array.max)
(left, right.tail.reverse)
}
def fold(array: Array[Int], result: Int = 0): Int = {
if (array.isEmpty) {
result
} else {
@syhily
syhily / Untitled.java
Last active November 8, 2016 18:39
Java 版本终端进度条实现。
import java.util.concurrent.*;
import java.util.*;
public class Untitled {
public static void main(String[] args) {
long total = 235;
long startTime = System.currentTimeMillis();
for (int i = 1; i <= total; i = i + 3) {
try {
package com.blueocn.platform.gateway.domain.util;
import java.time.*;
import java.util.Date;
import org.springframework.core.convert.converter.Converter;
public final class JSR310DateConverters {
private JSR310DateConverters() {}
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.logging.Logger;
import javax.servlet.http.HttpServletRequest;
public class IpHelper {
private static final Logger logger = Logger.getLogger("IpHelper");
private static String LOCAL_IP_STAR_STR = "192.168.";
public static final String LOCAL_IP;
public static final String HOST_NAME;
package com.blueocn.platform.gateway.service;
import java.io.File;
import java.util.Arrays;
import java.util.Optional;
/**
* Title: FileScanner
* Create Date: 2016-06-21 10:23
* Description:
package com.blueocn.mall.modules.utils;
import org.joda.time.DateTime;
/**
* Title: UIDGenerator
* Description: Unique id for common business order number
*
* @author Yufan
* @version 1.0.0
worker_processes 1;
events {
worker_connections 4096;
}
http {
server {
listen 8080;
location / {
package com.blueocn.user.server.v2.common;
import com.google.common.base.Preconditions;
import com.google.common.collect.Maps;
import org.springframework.util.Assert;
import java.io.Serializable;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import java.util.regex.Matcher;