Skip to content

Instantly share code, notes, and snippets.

View codethereforam's full-sized avatar
:octocat:
Focusing

thinkam codethereforam

:octocat:
Focusing
View GitHub Profile
@codethereforam
codethereforam / ExcelUtil.java
Last active January 7, 2022 06:08
基于easy POI的Excel导入/导出工具类
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.ExcelImportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.ImportParams;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.web.multipart.MultipartFile;
^(?:[\t ]*(?:\r?\n|\r))+
@codethereforam
codethereforam / CoolRetrying.java
Last active March 9, 2021 08:56
cool retrying
/**
* cool retrying
*
* @author yanganyu
* @date 2021/3/9
*/
@Slf4j
public class CoolRetrying<T> {
/**
* 重试次数
@codethereforam
codethereforam / Cons.java
Created December 29, 2020 09:40
implements scheme's cons in java
/**
* Cons
*
* @author yanganyu
* @date 2019/11/12 23:57
*/
public class Cons<L, R> {
private L left;
private R right;
mvn --settings E:\ install:install-file "-DgroupId=com.oracle" "-DartifactId=ojdbc6" "-Dversion=11.2.0.1.0" "-Dpackaging=jar" "-Dfile=C:\" "-Dmaven.repo.local=E:\"
@codethereforam
codethereforam / BatchQueryUtil.java
Last active February 19, 2021 17:30
分批查询工具类
/**
* 分批查询
*
* <p>
* sql中copy以下代码:
* <pre>{@code
* <if test="begin != null and pageSize != null">
* limit #{begin}, #{pageSize}
* </if>
* }</pre>
@codethereforam
codethereforam / idea方法注释.md
Last active February 19, 2021 17:39
idea方法注释live template
  • abbreviation: *
  • Template text:
    *  
     * $END$
     *
     * @author yanganyu 
     * @date $date$ $time$
    $params$ 
    
  • @return {@code $returnValue$}
@codethereforam
codethereforam / script.sh
Last active December 1, 2019 12:06
过滤掉每行不是英文单词的
# windows文件转Linux文件
dos2unix a.txt
# 处理并生成新文件(先trim每行)
cat a.txt | awk '{$1=$1;print}' | grep -E '^[A-Za-z]{2,}$' > b.txt
@codethereforam
codethereforam / user.xml
Created November 28, 2019 07:18
idea live template个人配置
<templateSet group="user">
<template name="odc" value="&lt;choose&gt;&#10; &lt;when test=&quot;orderByClause != null&quot;&gt;&#10; order by ${orderByClause}&#10; &lt;/when&gt;&#10; &lt;otherwise&gt;&#10; $CLIPBOARD$&#10; &lt;/otherwise&gt;&#10; &lt;/choose&gt;" description="" toReformat="true" toShortenFQNames="true">
<variable name="CLIPBOARD" expression="clipboard()" defaultValue="" alwaysStopAt="true" />
<context>
<option name="SQL_STATEMENT" value="true" />
<option name="SQL_STATEMENT_MEMSQL" value="true" />
<option name="SQL_STATEMENT_MYSQL" value="true" />
</context>
</template>
<template name="odcx" value="&lt;if test=&quot;orderByClause != null&quot;&gt;&#10; order by ${orderByClause}&#10;&lt;/if&gt;" description="" toReformat="false" toShortenFQNames="false">
@codethereforam
codethereforam / MqSender.java
Last active November 6, 2019 12:01
rabbitmq发送含header的消息
public void sendMsg(Map<String, String> headerMap, ...)
rabbitTemplate.convertAndSend(exchange, routingKey, msg,
message -> {
for (Map.Entry<String, String> entry : headerMap.entrySet()) {
message.getMessageProperties().setHeader(entry.getKey(), entry.getValue());
}
return message;
})