Skip to content

Instantly share code, notes, and snippets.

View aonrobot's full-sized avatar
💭
I may be slow to respond.

Auttawut Wiriyakreng aonrobot

💭
I may be slow to respond.
View GitHub Profile
List<AppInfo> appInfos = appInfoRepository.findByByTxnDate(LocalDate.parse("20200116", DateTimeFormatter.ofPattern("yyyyMMdd")));
Query query = this.entityManager.createNativeQuery("SELECT app.appId, app.caseId, [case].keyIndex FROM [esolution].[dbo].[AppInfo] app JOIN CaseInfo [case] ON app.caseId = [case].caseId WHERE app.txnDate >= Convert(datetime, ?1);");
query.setParameter(1, "2020-01-16");
Object obj = query.getResultList();
if (obj != null)
System.out.println((List<DataLakeAppInfo>) obj);
@aonrobot
aonrobot / introrx.md
Created January 19, 2020 12:08 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@aonrobot
aonrobot / docker run kong
Last active May 16, 2019 06:11
run kong without require https
docker run -d --name kong \
--network=kong-net \
-e "KONG_DATABASE=postgres" \
-e "KONG_PG_HOST=kong-database" \
-e "KONG_CASSANDRA_CONTACT_POINTS=kong-database" \
-e "KONG_PROXY_ACCESS_LOG=/dev/stdout" \
-e "KONG_ADMIN_ACCESS_LOG=/dev/stdout" \
-e "KONG_PROXY_ERROR_LOG=/dev/stderr" \
-e "KONG_ADMIN_ERROR_LOG=/dev/stderr" \
-e "KONG_ADMIN_LISTEN=0.0.0.0:8001, 0.0.0.0:8444 ssl" \
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
var foo = 10;
var bar = 20;
function impureFunc(arg){
arg = arg + bar * 2;
return arg;
}
var result = impureFunc(foo);
@aonrobot
aonrobot / pureFunction.js
Last active March 23, 2018 16:02
Pure Function @medium.com
var data = {value : 10};
function pureFunc(arg){
let a = 2;
arg = arg * a + 20;
return arg;
}
var result = pureFunc(data.value); //result = 40
var result = pureFunc(data.value); //result = 40
var data = {value : 10};
function impureFunc(arg){
let a = 2;
arg.value = arg.value * a + 20;
return arg.value;
}
var result = impureFunc(data); //result = 40
var result = impureFunc(data); //result = 100
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<!-- ENV config-->
<script src="[JS_PATH]/env.js"></script>
<!-- table2excel core-->
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<!-- table2excel core-->
<script src="[JS_PATH]/table2excel.bundle.js"></script>
</head>
<button class="btn btn-warning" id="table2excel">Export to Excel</button>
<table id="r3tb1" class="table">
<thead>
...
</thead>
<tbody>
...
</tbody>
</table>