Skip to content

Instantly share code, notes, and snippets.

View liutf's full-sized avatar
:octocat:

liutf liutf

:octocat:
  • Canton , China
View GitHub Profile
@liutf
liutf / SnowflakeIdGenerator.java
Created September 30, 2018 07:00
生成分布式ID-雪花算法
package com.net263.server.service.impl;
import com.ctrip.framework.foundation.internals.Utils;
import com.ctrip.framework.foundation.internals.io.BOMInputStream;
import com.net263.server.service.interfaces.IdGenerator;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct;
import java.io.File;
api.map("l", "R");
api.map("h", "E");
package com.net263.util;
import com.google.common.base.Charsets;
import com.google.common.io.Files;
import org.springframework.beans.factory.config.YamlPropertiesFactoryBean;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import java.io.File;
import java.util.Arrays;
@liutf
liutf / 0_reuse_code.js
Created October 8, 2016 02:57
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
package com.net263.util;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Date;
import static com.net263.constants.FoggConst.TIMES.PATTERN_YYYY_MM_DD_HHMMSS;