Skip to content

Instantly share code, notes, and snippets.

-- 置顶
UPDATE t_article SET display_order=display_order-1 WHERE display_order>1;
UPDATE t_article SET display_order=3 WHERE id=3;
-- 置底
UPDATE t_article SET display_order=display_order+1 WHERE display_order<3;
UPDATE t_article SET display_order=1 WHERE id=3;
-- 上移
year model screen cpu memory ssd gpu price
2018 15.4 8850H i7 2.6-4.6GHz 6Core 32G 1tb R560X 4GB 149xx
2018 15.4 8950HK i9 2.9-5.0GHz 6Core 32G 1tb R560X 4GB 160xx
2019 16.1 9750H i7 2.6-3.9GHz 6Core 16G 512gb 5300M 4GB 160xx,min:155xx
2019 16.1 9750H i7 2.6-3.9GHz 6Core 32G 512gb 5300M 4GB 182xx,min:180xx
2019 16.1 9750H i7 2.6-3.9GHz 6Core 32G 1tb 5300M 4GB 192xx,min:192xx
2019 16.1 9880H i9 2.3-4.8GHz 8Core 16G 1tb 5600M 4GB 187xx,min:180xx
type 含义
feat 增加新功能
fix 修复bug
docs 文档改动
style 代码风格改动
refactor 重构
@czwen
czwen / my.cnf
Created November 20, 2019 07:01 — forked from fevangelou/my.cnf
Optimized my.cnf configuration for MySQL/MariaSQL (on Ubuntu, CentOS etc. servers)
# Optimized my.cnf configuration for MySQL/MariaSQL
#
# by Fotis Evangelou, developer of Engintron (engintron.com)
#
# === Updated December 2018 ===
#
# The settings provided below are a starting point for a 2GB - 4GB RAM server with 2-4 CPU cores.
# If you have less or more resources available you should adjust accordingly to save CPU,
# RAM and disk I/O usage.
# The settings marked with a specific comment or the word "UPD" after the value
show processlist;
show variables like "%tmp%";
String regex = "^(\\d+\\.)?(\\d+\\.)?(\\d+\\.)?(\\*|\\d+)$";
https://stackoverflow.com/questions/82064/a-regex-for-version-number-parsing
@czwen
czwen / gist:fd60d6e131a41760bb8ae3f074268c9b
Created January 16, 2019 09:32
mysql 版本字符串比较
-- 获取小于等于12.0.2版本的最新数据
SELECT *, CONCAT(
LPAD(SUBSTRING_INDEX(SUBSTRING_INDEX(version, '.', 1), '.', -1), 5, '0'),
LPAD(SUBSTRING_INDEX(SUBSTRING_INDEX(version, '.', 2), '.', -1), 5, '0'),
LPAD(SUBSTRING_INDEX(SUBSTRING_INDEX(version, '.', 3), '.', -1), 5, '0')) vcode
FROM foo
having vcode <= CONCAT(LPAD(12,5,'0'), LPAD(0,5,'0'), LPAD(2,5,'0'))
order by vcode desc;
@czwen
czwen / gist:84d1f019552c7d6c1ef168823dbc198f
Created November 28, 2018 11:21 — forked from godtao/gist:4138058
网站压力测试工具webbench

Install

wget http://blog.s135.com/soft/linux/webbench/webbench-1.5.tar.gz
tar zxvf webbench-1.5.tar.gz
cd webbench-1.5
make && make install

Usage

webbench --help

- (SCNNode*)nodeFromDaeAtPath:(NSString*)path withIdentifier:(NSString*)identifier {
NSURL *urlToColladaFile = [[NSBundle mainBundle] URLForResource:path withExtension:@"dae"]; // Create NSURL from input path
SCNSceneSource *sceneSource = [[SCNSceneSource alloc] initWithURL:urlToColladaFile options:nil]; // Create a temporary SCNScene
SCNNode *node = [sceneSource entryWithIdentifier:identifier withClass:[SCNNode class]]; // Create a node from the model represented by the identifier
return node;
}
@czwen
czwen / gist:76a26fd9513d8d74be3723c64e17ae55
Last active August 16, 2017 10:21
check wifi toggle status
#import <ifaddrs.h>
#import <net/if.h>
- (BOOL) isWiFiEnabled {
NSCountedSet * cset = [NSCountedSet new];
struct ifaddrs *interfaces;
if( ! getifaddrs(&interfaces) ) {