Skip to content

Instantly share code, notes, and snippets.

View lixingcong's full-sized avatar
😂
Face With Tears of Joy...

Lixingcong lixingcong

😂
Face With Tears of Joy...
View GitHub Profile
@lixingcong
lixingcong / adblock-chrome.txt
Created April 8, 2018 09:05
AdBlock自定义规则
||https://imgcache.qq.com/ptlogin/v4/style/20/images/shouQ_v2/small_24_tiny.png
@lixingcong
lixingcong / config_local.json
Last active December 4, 2019 01:42
shadowsocks-libev startup script
{
"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 November 22, 2019 00:27
Amplify block list for my phone
微信
版本 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 November 6, 2019 09:13
重载QDataStream<<和>>运算符序列化和反序列化
#include <QDataStream>
#include <QString>
#include <QDebug>
struct Data1
{
bool isOk;
int value;
QString str;
};
@lixingcong
lixingcong / cpp11_std_forward.cpp
Last active October 22, 2019 03:03
C++11的右值引用:移动语义+完美转发
#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"; }
};
@lixingcong
lixingcong / random.hpp
Created October 5, 2019 12:10
生成随机数C++
#ifndef MYRANDOM_HPP
#define MYRANDOM_HPP
// 源码:https://evileg.com/en/post/306
#include <random>
namespace details
{
/// True if type T is applicable by a std::uniform_int_distribution
@lixingcong
lixingcong / q_invokable.h
Created April 24, 2019 12:45
Q_INVOKABLE宏的简单用法
#include <QObject>
#include <QDebug>
class MyClass : public QObject
{
Q_OBJECT
public:
explicit MyClass(QObject *parent = nullptr):QObject(parent){}
Q_INVOKABLE void printHello(const QString& text)
@lixingcong
lixingcong / Label.cpp
Created April 15, 2019 07:50
qt5的Q_D宏和Q_Q宏封装pimp
#include "Label.h"
#include "Label_p.h"
Label::Label(const QString& text, QWidget *parent) : QLabel(text, parent),
d_ptr(new LabelPrivate(this))
{
}
QString Label::myGetText()
{
@lixingcong
lixingcong / .gitconfig
Last active April 9, 2019 09:04
A simple configure template for git commands. 注意:不再更新,新版存放在Dropbox上 2019-04-09
[user]
name = xxx
email = xxx@xx.com
signingkey = 37A9AD93
[push]
default = simple
[alias]
ad = add *
cm = commit -am
cmt = commit -m
@lixingcong
lixingcong / nekosms_filter.py
Last active October 16, 2018 07:17
用于生成NekoSMS过滤规则的脚本
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Date: 2018-06-06
# NekoSMS filters print/encode
import json
# print keyword from json
def print_kw(filename):