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 / php-client_get.php
Last active July 5, 2021 08:04
PHP测试POST/GET/JSON解析ECHO的demo
<?php
function get($url, $hostname, $data=NULL)
{
$fullUrl=$url;
if(NULL!==$data){
$fullUrl.= '?'.http_build_query($data);
}
@lixingcong
lixingcong / demo1.cpp
Last active April 14, 2021 14:17
C各种指针:数组指针,函数指针,回调函数,指针的引用,指针的指针
#include <iostream>
#include "math.h"
// 数组指针
using namespace std;
const int COL = 2;
void printRowData(int* p)
@lixingcong
lixingcong / build-shadowsocks.sh
Last active March 17, 2021 10:20
静态编译ss
#!/bin/bash
# Update: 2021-03-17
# Modified by lixingcong
# Fork from https://github.com/necan/shadowsocks-libev-static-build
# Attention: modified from https://github.com/shadowsocks/shadowsocks-libev/blob/master/docker/mingw/build.sh
# The script does not need to run as root
@lixingcong
lixingcong / fetchUrl_gzip.php
Created February 8, 2021 14:09 — forked from mgng/fetchUrl_gzip.php
file_get_contents で Accept-Encoding:gzip 指定
<?php
function fetchUrl( $url, $gzip = false ) {
$raw = file_get_contents( $url, false, $context = stream_context_create( array(
'http' => array(
'method' => 'GET',
'header' => 'Accept-Encoding:' . ( $gzip ? 'gzip,deflate' : 'identity' ) . "\r\n",
)
) ) );
if ( $raw === false ) {
@lixingcong
lixingcong / delete_git_submodule.md
Created December 30, 2020 05:59 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@lixingcong
lixingcong / GitBashHere.reg
Last active December 29, 2020 10:12
添加"git bash"到右键菜单
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\background\shell\git_shell]
@="Git Ba&sh Here"
"Icon"="D:\\Program_Files\\Git\\git-bash.exe"
[HKEY_CLASSES_ROOT\Directory\background\shell\git_shell\command]
@="\"D:\\Program_Files\\Git\\git-bash.exe\" \"--cd=%v.\""
[HKEY_CLASSES_ROOT\Directory\shell\git_shell]
@lixingcong
lixingcong / validator.h
Created April 23, 2020 02:00
QLineEdit validator for IP and Port
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)
{}
@lixingcong
lixingcong / eclipse-201903内置emacs键位.md
Last active April 2, 2020 09:17
我的IDE键位中英对照

Eclipse内置版本

鼠标导航

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

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 February 22, 2020 11:56
[deprecated in 2016] a script to generate chinadns_blacklist.txt
google.com
twitter.com
tumblr.com
facebook.com
youtube.com
telegram.org
instagram.com
fbcdn.net
google.de
google.co.jp