2020年9月6日 星期日

mysql partition

 

1. https://cola.workxplay.net/mysql-partitioning-for-performance-optimization/


2. https://mariadb.com/kb/en/partitioning-limitations/

3. https://kkc.github.io/2017/07/07/mysql-partitioning/

2020年8月4日 星期二

PHP clousre and access modify object


: use 
and 
: &$ 

###
https://ourcodeworld.com/articles/read/712/how-to-change-the-value-of-a-variable-outside-of-the-scope-within-a-closure-function-in-php


https://ithelp.ithome.com.tw/articles/10132747

2020年8月3日 星期一

PHP change table name to lowcase




$subject = "From ab_cD efg";
$callback = function($match)
{
    //var_dump($match);
    //echo $match[1];
    return "FROM " . strtolower($match[1]) . " ";
    //return preg_replace($match[1], strtolower($match[1]) ,$match[0]);
};
echo preg_replace_callback('/from\s+([\w]+)\s*/i', $callback, $subject, 1);

 echo "\n";
echo preg_replace_callback('/from\s+([\w]+)\s*/i', $callback, "From ab_cD", 1);
 echo "\n";
echo preg_replace_callback('/from\s+([\w]+)\s*/i', $callback, "Fsssc ab_cD", 1);


ref
http://tools.jb51.net/regex/create_reg
// 将文本中的年份增加一年.
$text = "April fools day is 04/01/2002n";
$text.= "Last christmas was 12/24/2001n";
// 回调函数
function next_year($matches)
{
  // 通常: $matches[0]是完成的匹配
  // $matches[1]是第一个捕获子组的匹配
  // 以此类推
  return $matches[1].($matches[2]+1);
}
echo preg_replace_callback(
            "|(d{2}/d{2}/)(d{4})|",
            "next_year",
            $text);

2020年6月10日 星期三

Docker Cmd and redis

https://www.tecmint.com/run-docker-container-in-background-detached-mode/


https://github.com/sickp/docker-alpine-redis/blob/master/versions/4.0.4/Dockerfile

https://medium.com/@xyz030206/dockerfile-%E4%B8%AD%E7%9A%84-entrypoint-9653c3b2d2f8

2020年5月26日 星期二

dotnet core log

1. Using lograte http://n.sfs.tw/content/index/12926
2.  https://www.nuget.org/packages/NLog.Config/
3. https://dotblogs.com.tw/ricochen/2018/04/06/024020
4 https://blog.yowko.com/asp-net-core-default-log-nlog-serilog/
5. https://medium.com/@WilliamWhetstone/net-core-project-%E5%BE%9E%E9%9B%B6%E9%96%8B%E5%A7%8B-nlog-b8effb9561f9
6. https://blog.johnwu.cc/article/ironman-day19-asp-net-core-nlog-log4net.html

2020年5月24日 星期日

Nginx survey

1.  cache and buffer


2. nginux proxy

cache_2
cache_3
cache_4
cahce_5
https://blog.techbridge.cc/2017/06/17/cache-introduction/


https://smalltowntechblog.wordpress.com/2014/10/25/nginx-location-regex%E7%AD%86%E8%A8%98/

2020年5月20日 星期三