Skip to content

Instantly share code, notes, and snippets.

Avatar
😂
Face With Tears of Joy...

Lixingcong lixingcong

😂
Face With Tears of Joy...
View GitHub Profile
@lixingcong
lixingcong / validator.h
Created Apr 23, 2020
QLineEdit validator for IP and Port
View validator.h
class MyIPValidator : public QRegularExpressionValidator
{
// https://www.qtcentre.org/threads/6228-Ip-Address-Validation
public:
MyIPValidator(const QString& defaultString, QObject* parent = Q_NULLPTR)
: QRegularExpressionValidator(
QRegularExpression("^0*(2(5[0-5]|[0-4]\\d)|1?\\d{1,2})(\\.0*(2(5[0-5]|[0-4]\\d)|1?\\d{1,2})){3}$"), parent)
, m_defaultString(defaultString)
{}
View eclipse-201903内置emacs键位.md

Eclipse内置版本

鼠标导航

操作 英文 键位偏好
Line up alt+k
Line down alt+j
Previous column ctrl+k
Next column ctrl+j
View IntegerTypesRange.md

The following table provides the details of standard integer types with their storage sizes and value ranges

Type Storage size Value range
char 1 byte -128 to 127 or
0 to 255
unsigned char 1 byte 0 to 255
signed char 1 byte -128 to 127
int 2 bytes or
4 bytes
-32768 to 32767 or
-2147483648 to 2147483647
unsigned int 2 bytes or
4 bytes
0 to 65535 or
0 to 4294967295
short 2 bytes -32768 to 32767
@lixingcong
lixingcong / domains.txt
Last active Feb 22, 2020
[deprecated in 2016] a script to generate chinadns_blacklist.txt
View domains.txt
google.com
twitter.com
tumblr.com
facebook.com
youtube.com
telegram.org
instagram.com
fbcdn.net
google.de
google.co.jp
@lixingcong
lixingcong / my_site.conf
Last active Feb 20, 2020
nginx autoindex timezone setting
View my_site.conf
location ^~ /demo {
alias /var/www/demo/;
autoindex on;
# set to on means use localtime
autoindex_localtime on;
# show size with unit 'MB' instead of 'Byte'
autoindex_exact_size off;
}
@lixingcong
lixingcong / adblock-chrome.txt
Created Apr 8, 2018
AdBlock自定义规则
View adblock-chrome.txt
||https://imgcache.qq.com/ptlogin/v4/style/20/images/shouQ_v2/small_24_tiny.png
@lixingcong
lixingcong / config_local.json
Last active Dec 4, 2019
shadowsocks-libev startup script
View config_local.json
{
"server":"123.123.123.123",
"server_port":8989,
"local_port":1080,
"password":"password",
"timeout":300,
"nameserver":"8.8.4.4",
"method":"salsa20",
"mode":"tcp_and_udp",
"fast_open": false,
@lixingcong
lixingcong / Amplify.txt
Last active Nov 22, 2019
Amplify block list for my phone
View Amplify.txt
微信
版本 6.7 GooglePlay版
唤醒锁
正则表达式 WakerLock:+[0-9]{0,26} 间隔999999
SyncService
StnCallBack
定时器
# 正则表达式设置Amplify链接 https://forum.xda-developers.com/showpost.php?p=64411243&postcount=6237
正则表达式 ALARM_ACTION+[(0-9)]{0,26} 间隔999999
com.tencent.mm/.booter/MMReceivers$AlarmReceiver 间隔60
@lixingcong
lixingcong / qdatastream_overload.cpp
Created Nov 6, 2019
重载QDataStream<<和>>运算符序列化和反序列化
View qdatastream_overload.cpp
#include <QDataStream>
#include <QString>
#include <QDebug>
struct Data1
{
bool isOk;
int value;
QString str;
};
@lixingcong
lixingcong / cpp11_std_forward.cpp
Last active Oct 22, 2019
C++11的右值引用:移动语义+完美转发
View cpp11_std_forward.cpp
#include <iostream>
#include <memory>
#include <utility>
// 源码已稍作修改,出自:https://en.cppreference.com/w/cpp/utility/forward
struct A
{
A(int&& n) { std::cout << "rvalue overload, n=" << n << "\n"; }
A(int& n) { std::cout << "lvalue overload, n=" << n << "\n"; }
};