This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.function.Consumer; | |
import java.util.function.Function; | |
import org.apache.ibatis.session.ExecutorType; | |
import org.apache.ibatis.session.SqlSession; | |
import org.apache.ibatis.session.SqlSessionFactory; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.stereotype.Component; | |
import org.springframework.transaction.support.TransactionOperations; | |
import org.springframework.transaction.support.TransactionTemplate; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <chrono> | |
#include <ctime> | |
#include <iostream> | |
#include <string> | |
/** | |
* date format to string | |
* https://cplusplus.com/reference/ctime/strftime/ | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef PROJECT_TIMER_HPP | |
#define PROJECT_TIMER_HPP | |
#include <ratio> | |
#include <chrono> | |
namespace datetime { | |
// DurationPeriod | |
typedef std::chrono::nanoseconds Nano; // 纳秒 <long, long> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ( | |
"log" | |
"golang.org/x/crypto/bcrypt" | |
) | |
// go get -u golang.org/x/crypto/bcrypt | |
func GenerateBcryptSecret(plainPwd string) (string, error) { | |
return GenerateBcryptSecretWithCost(plainPwd, bcrypt.DefaultCost) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"crypto/hmac" | |
"crypto/sha512" | |
"encoding/hex" | |
"fmt" | |
) | |
func main() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.math.BigDecimal; | |
import java.math.RoundingMode; | |
/** | |
* 两经纬度点距离计算 | |
* </p> | |
* 根据圆周率计算两点地图经纬度距离 | |
* | |
* @author MinGRn <br > [email protected] | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ( | |
"github.com/gocarina/gocsv" | |
"os" | |
"time" | |
) | |
type DateTime struct { | |
time.Time | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import "math" | |
// VerifyChineseMainlandIdCard 检查身份证号码合法性 | |
// | |
// Wikipedia: | |
// https://zh.wikipedia.org/wiki/中华人民共和国公民身份号码 | |
// | |
// China gov: | |
// http://www.stats.gov.cn/tjsj/tjbz/tjyqhdmhcxhfdm | |
// |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.servlet.http.HttpServletResponse; | |
import java.io.IOException; | |
import java.io.PrintWriter; | |
public final class ResponseUtils { | |
private ResponseUtils() { | |
} | |
public static void writeJsonObject(HttpServletResponse response, Object object) { |
NewerOlder