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 / qt_gbk_main.cpp
Created June 27, 2018 04:01
Qt4 Qt5的GBK解码
#include <QCoreApplication>
#include <QDebug>
#include "qt_gbk_stringdecoder.h"
#include "qt_gbk_strs.h"
int main(int argc, char *argv[])
{
//QCoreApplication a(argc, argv);
#if QT_VERSION < 0x050000
@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):
@lixingcong
lixingcong / dante_acl.py
Created May 25, 2018 07:29
dante配置ACL生成器
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# 用于打印dante.conf的socks pass/block的
# 目标规则(Target IPs)
# Document: https://www.inet.no/dante/doc/1.4.x/sockd.conf.5.html
TELEGRAM_PASS_CIDR=(
"91.108.4.0/22",
"91.108.8.0/21",
@lixingcong
lixingcong / grub2.cfg
Last active May 8, 2018 03:58
GRUB2 bootiing linux iso
menuentry "Boot Ubuntu ISO" {
set root=(hd1,msdos4)
set isofile=/lubuntu-16.04.3-desktop-amd64.iso
loopback loop $isofile
linux (loop)/casper/vmlinuz.efi persistent boot=casper iso-scan/filename="$isofile" quiet splash ro locale=zh_CN.UTF-8 noprompt --
initrd (loop)/casper/initrd.lz
}
menuentry "Boot ArchLinux ISO" {
@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 / demo1_static_cast.cpp
Last active February 28, 2018 11:20
Cast in C++
/*
static_cast<type>(var) 静态类型转换,编译的时c++编译器会做类型检查
基本类型(int,float...void*)能转换,通过继承关系的类之间也能相互转换
但是不能转换不同指针类型
*/
#include <iostream>
using namespace std;
struct S1{
@lixingcong
lixingcong / demo_cout.cpp
Last active February 28, 2018 07:05
C++ std cout format example
#include <iostream>
#include <iomanip>
using namespace std;
void restore_fmt(std::_Ios_Fmtflags fmt)
{
cout << "restore flag" << endl;
cout.flags(fmt);
cout << endl;
@lixingcong
lixingcong / kindle_del_sdr.py
Created February 14, 2018 14:16
kindle delete useless sdr files
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Create on: 2015年10月25日 下午4:48:30
# 说明:删除重复文件 dfs递归搜索目录判断有垃圾sdr文件
# Author:lixingcong
import os
import shutil
import time
@lixingcong
lixingcong / .gitignore
Last active February 26, 2018 13:02
QT下的qmake的Makefile模板
# C++ objects and libs
*.slo
*.lo
*.o
*.a
*.la
*.lai
*.so
*.dll
*.dylib
@lixingcong
lixingcong / readme.md
Created February 7, 2018 03:56
git for windows GBK乱码

mintty界面GBK

mintty界面编码改为zh-cn GBK

右击git bash标题->Options->Text
Locale选择zh_CN,Char set选择GBK

git界面GBK